diff --git a/bindings/emscripten/build.py b/bindings/emscripten/build.py index eb76504f..1bb7dea2 100755 --- a/bindings/emscripten/build.py +++ b/bindings/emscripten/build.py @@ -184,6 +184,20 @@ { return wrapPointer(_P1_Affine_to_jacobian_0(this.ptr), P1); };; """ p1_cpp += """ +byte* EMSCRIPTEN_KEEPALIVE P1_Affine_serialize_eip2537_0(const P1_Affine* self) +{ byte out[128*1]; + self->serialize_eip2537(out); + return out; +} +""" +p1_js += """ +P1_Affine.prototype['serialize_eip2537'] = P1_Affine.prototype.serialize_eip2537 = /** @this{Object} */ +function() +{ var out = _P1_Affine_serialize_eip2537_0(this.ptr); + return new Uint8Array(HEAPU8.subarray(out, out + 128*1)); +};; +""" +p1_cpp += """ byte* EMSCRIPTEN_KEEPALIVE P1_Affine_serialize_0(const P1_Affine* self) { byte out[96*1]; self->serialize(out); @@ -340,6 +354,20 @@ { return wrapPointer(_P1_to_affine_0(this.ptr), P1_Affine); };; """ p1_cpp += """ +byte* EMSCRIPTEN_KEEPALIVE P1_serialize_eip2537_0(const P1* self) +{ byte out[128*1]; + self->serialize_eip2537(out); + return out; +} +""" +p1_js += """ +P1.prototype['serialize_eip2537'] = P1.prototype.serialize_eip2537 = /** @this{Object} */ +function() +{ var out = _P1_serialize_eip2537_0(this.ptr); + return new Uint8Array(HEAPU8.subarray(out, out + 96*1)); +};; +""" +p1_cpp += """ byte* EMSCRIPTEN_KEEPALIVE P1_serialize_0(const P1* self) { byte out[96*1]; self->serialize(out); @@ -1151,7 +1179,7 @@ def xchg_1vs2(matchobj): print("//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", file=fd) print(common_cpp, file=fd) print(p1_cpp, file=fd) -print(re.sub(r'((?