UNPKG

lambdaworks-groth16-ts

Version:

TypeScript bindings for LambdaWorks Groth16 SNARK prover

26 lines 844 B
export class Groth16Verifier { constructor(wasmInstance) { this.wasmInstance = wasmInstance; } /** * Verify a Groth16 proof */ verify(verifyingKey, publicInputs, proof) { return this.wasmInstance.groth16_verify(verifyingKey, publicInputs, proof); } /** * Batch verify multiple proofs (more efficient) */ batchVerify(verifyingKey, proofData) { return this.wasmInstance.groth16_batch_verify(verifyingKey, proofData); } /** * Verify proof from JSON format */ verifyFromJson(verifyingKey, publicInputsJson, proofJson) { const publicInputs = JSON.parse(publicInputsJson); const proof = this.wasmInstance.proof_from_json(proofJson); return this.verify(verifyingKey, publicInputs, proof); } } //# sourceMappingURL=verifier.js.map