Example #1
0
 def _invoke_groth16_bls12_377_verify(vk: Groth16.VerificationKey,
                                      proof: Groth16.Proof,
                                      inputs: List[str]) -> bool:
     vk_evm = Groth16.verification_key_to_contract_parameters(
         vk, BLS12_377_PAIRING)
     proof_evm = Groth16.proof_to_contract_parameters(
         proof, BLS12_377_PAIRING)
     inputs_evm = hex_list_to_uint256_list(inputs)
     return CONTRACT_INSTANCE.functions.testVerify(vk_evm, proof_evm,
                                                   inputs_evm).call()
Example #2
0
 def test_alt_bn128_groth16_proof_parameters(self) -> None:
     extproof = EXTPROOF_ALT_BN128_GROTH16
     proof_parameters = Groth16.proof_to_contract_parameters(
         extproof.proof, ALT_BN128_PAIRING)
     self.assertEqual(PROOF_ALT_BN128_GROTH16_PARAMETERS, proof_parameters)
Example #3
0
 def test_bw6_761_groth16_proof_parameters(self) -> None:
     extproof = EXTPROOF_BW6_761_GROTH16
     proof_parameters = Groth16.proof_to_contract_parameters(
         extproof.proof, BW6_761_PAIRING)
     self.assertEqual(PROOF_BW6_761_GROTH16_PARAMETERS, proof_parameters)