@@ -24,16 +24,16 @@ class AvmVerifierTests : public ::testing::Test {
2424 };
2525
2626 // Helper function to create proof.
27- static NativeProofResult create_proof_and_vk ()
27+ static NativeProofResult create_proof ()
2828 {
2929 auto [trace, public_inputs] = testing::get_minimal_trace_with_pi ();
3030
3131 Prover prover;
3232 auto public_inputs_cols = public_inputs.to_columns ();
33- const auto [ proof, vk_data] = prover.prove (std::move (trace));
34- const auto verification_key = prover. create_verification_key (vk_data );
33+ const auto proof = prover.prove (std::move (trace));
34+ auto vk = AvmProvingHelper:: create_verification_key (AvmProvingHelper (). get_verification_key () );
3535
36- return { proof, verification_key , public_inputs_cols };
36+ return { proof, vk , public_inputs_cols };
3737 }
3838};
3939
@@ -43,11 +43,9 @@ TEST_F(AvmVerifierTests, GoodPublicInputs)
4343 GTEST_SKIP () << " Skipping slow test" ;
4444 }
4545
46- NativeProofResult proof_result = create_proof_and_vk ();
47- auto [proof, verification_key, public_inputs_cols] = proof_result;
48-
49- Verifier verifier (verification_key);
46+ auto [proof, vk, public_inputs_cols] = create_proof ();
5047
48+ Verifier verifier (vk);
5149 const bool verified = verifier.verify_proof (proof, public_inputs_cols);
5250
5351 ASSERT_TRUE (verified) << " native proof verification failed" ;
@@ -59,11 +57,10 @@ TEST_F(AvmVerifierTests, NegativeBadPublicInputs)
5957 GTEST_SKIP () << " Skipping slow test" ;
6058 }
6159
62- NativeProofResult proof_result = create_proof_and_vk ();
63- auto [proof, verification_key, public_inputs_cols] = proof_result;
60+ auto [proof, vk, public_inputs_cols] = create_proof ();
6461 auto verify_with_corrupt_pi_col = [&](size_t col_idx) {
6562 public_inputs_cols[col_idx][5 ] += FF::one ();
66- Verifier verifier (verification_key );
63+ Verifier verifier (vk );
6764 const bool verified = verifier.verify_proof (proof, public_inputs_cols);
6865 ASSERT_FALSE (verified)
6966 << " native proof verification succeeded, but should have failed due to corruption of public inputs col "
@@ -73,17 +70,17 @@ TEST_F(AvmVerifierTests, NegativeBadPublicInputs)
7370 for (size_t col_idx = 0 ; col_idx < 4 ; col_idx++) {
7471 verify_with_corrupt_pi_col (col_idx);
7572 }
76- Verifier verifier (verification_key );
73+ Verifier verifier (vk );
7774 const bool verified = verifier.verify_proof (proof, public_inputs_cols);
7875 ASSERT_TRUE (verified) << " native proof verification failed, but should have succeeded" ;
7976}
8077
8178// Verify that the actual proof size matches COMPUTED_AVM_PROOF_LENGTH_IN_FIELDS
8279TEST_F (AvmVerifierTests, ProofSizeMatchesComputedConstant)
8380{
84- NativeProofResult proof_result = create_proof_and_vk ();
81+ auto [proof, vk, public_inputs_cols] = create_proof ();
8582
86- const size_t actual_proof_size = proof_result. proof .size ();
83+ const size_t actual_proof_size = proof.size ();
8784 const size_t computed_proof_size = AvmFlavor::COMPUTED_AVM_PROOF_LENGTH_IN_FIELDS;
8885
8986 EXPECT_EQ (actual_proof_size, computed_proof_size)
0 commit comments