micro-zk-proofs
Version:
Create & verify zero-knowledge SNARK proofs in parallel, using noble cryptography
18 lines • 623 B
JavaScript
import {} from '@noble/curves/abstract/weierstrass';
import { bn254 } from '@noble/curves/bn254';
import { wrkr } from 'micro-wrkr';
function buildMSM(point) {
return (list) => {
if (!list.length)
return point.ZERO;
const points = list.map((i) => new point(i.point.px, i.point.py, i.point.pz));
const scalars = list.map((i) => i.scalar);
return point.msm(points, scalars);
};
}
const handlers = {
bn254_msmG1: buildMSM(bn254.G1.ProjectivePoint),
bn254_msmG2: buildMSM(bn254.G2.ProjectivePoint),
};
wrkr.initWorker(handlers);
//# sourceMappingURL=msm-worker.js.map