UNPKG

@nori-zk/proof-conversion

Version:

Verifying zkVM proofs inside o1js circuits, to generate Mina compatible proof

15 lines 634 B
// stores some of the data that can be precomputed when using affine repr: import { Provable } from 'o1js'; import { FpC } from '../towers/index.js'; // see: https://eprint.iacr.org/2013/722.pdf class AffineCache { constructor(p) { this.xp_neg = p.x.neg().assertCanonical(); this.yp_prime = p.y.inv().assertCanonical(); this.yp_prime = Provable.witness(FpC.provable, () => p.y.inv().assertCanonical()); this.yp_prime.mul(p.y).assertEquals(FpC.from(1n)); this.xp_prime = this.xp_neg.mul(this.yp_prime).assertCanonical(); } } export { AffineCache }; //# sourceMappingURL=precompute.js.map