UNPKG

micro-zk-proofs

Version:

Create & verify zero-knowledge SNARK proofs in parallel, using noble cryptography

27 lines 976 B
import type { Fp2 } from '@noble/curves/abstract/tower.js'; import { type WeierstrassPoint } from '@noble/curves/abstract/weierstrass.js'; /** Multi-scalar multiplication input pair. */ export type MSMInput<T> = { /** Curve point to multiply. */ point: WeierstrassPoint<T>; /** Scalar multiplier. */ scalar: bigint; }; /** Worker handlers exposed for bn254 MSM execution. */ export type bn254MSMInput = { /** * Runs a G1 multi-scalar multiplication batch. * @param list - Point-scalar pairs. * @returns MSM result in G1. */ bn254_msmG1: (list: MSMInput<bigint>[]) => WeierstrassPoint<bigint>; /** * Runs a G2 multi-scalar multiplication batch. * @param list - Point-scalar pairs. * @returns MSM result in G2. */ bn254_msmG2: (list: MSMInput<Fp2>[]) => WeierstrassPoint<Fp2>; }; /** Worker handler type exported for `wrkr`. */ export type Handlers = bn254MSMInput; //# sourceMappingURL=msm-worker.d.ts.map