var points = (function(){ //order of the finite field used to define ed25519. //2^255 - 19. var Order = fq.order(); var EllipticGroupOrder = 7237005577332262213973186563042994240857116359379907606001950938285454250989n;//order of the elliptic curve group ed25519, div 8. var Extended = nobleEd25519.ExtendedPoint; var Point = nobleEd25519.Point; // -(121665/121666) // a constant in the definition of the ed25519 elliptic curve. var D = 37095705934669439343138083508754565189542113879843219016388785533085940283555n; function compressed2affine(X0){ //base64 encoded to affine. var X = verkle_binary.string_to_array(atob(X0)); return(compressed2affine2(X)); }; function compressed2affine2(X){ // array encoded to affine. if(!(X.length === 32)){ console.log("bad length"); 1+1n; }; var B1 = X[0]; var P = JSON.parse(JSON.stringify(X)); var S; if (B1 >= 128) { P[0] = P[0] - 128; S = 1n; } else { S = 0n; }; var U0 = verkle_binary.array_to_int(P); if(U0 > fq.order()) { console.log(P[0]); console.log(U0); console.log(fq.order()); console.log("failure"); 1+1n; }; var U = fq.decode(U0); var UU = fq.mul(U, U); var DUU = fq.sub(1n, fq.mul(D, UU)); var T = fq.add(1n, UU); var B = fq.inv(DUU); return(decompress_point2(U, S, T, B)); }; function compressed2affine_batch(l){ var q = l.map(function(x){ var y = verkle_binary.string_to_array(atob(x)); var b1 = y[0]; var p = JSON.parse(JSON.stringify(y)); var s; if(b1 >= 128){ p[0] = p[0] - 128; s = 1n; } else { s = 0n; }; var u = fq.decode(verkle_binary.array_to_int(p)); var uu = fq.mul(u, u); var duu = fq.sub(1n, fq.mul(D, uu)); var t = fq.add(1n, uu); return([u, s, t, duu]); }); var duus = q.map(function(x){ return(x[3]); }); var bs = fq.batch_inverse(duus); var r = []; for(var i = 0; i