Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
sender_updated_detail: newAlice.detail,
signature_R8x: signature.R8[0],
signature_R8y: signature.R8[1],
signature_S: signature.S,
sender_proof: [bobHash],
sender_proof_pos: [1]
}
const circuit = new Circuit(circuitDef)
console.log('Calculating witnesses....')
const witness = circuit.calculateWitness(circuitInput)
console.log('Generating proof....')
const { proof, publicSignals } = zkSnark.genProof(
unstringifyBigInts(provingKey), witness
)
const isValid = zkSnark.isValid(
unstringifyBigInts(verificationKey),
proof,
publicSignals
)
console.log(`Inputs passes circuit: ${isValid}`)
sender_proof: [bobHash],
sender_proof_pos: [1]
}
const circuit = new Circuit(circuitDef)
console.log('Calculating witnesses....')
const witness = circuit.calculateWitness(circuitInput)
console.log('Generating proof....')
const { proof, publicSignals } = zkSnark.genProof(
unstringifyBigInts(provingKey), witness
)
const isValid = zkSnark.isValid(
unstringifyBigInts(verificationKey),
proof,
publicSignals
)
console.log(`Inputs passes circuit: ${isValid}`)
function snarkVerify(proof) {
proof = unstringifyBigInts2(websnarkUtils.fromSolidityInput(proof))
const verification_key = unstringifyBigInts2(require('../build/circuits/withdraw_verification_key.json'))
return groth.isValid(verification_key, proof, proof.publicSignals)
}
function snarkVerify(proof) {
proof = unstringifyBigInts2(websnarkUtils.fromSolidityInput(proof))
const verification_key = unstringifyBigInts2(require('../build/circuits/withdraw_verification_key.json'))
return groth.isValid(verification_key, proof, proof.publicSignals)
}