@@ -17,6 +17,10 @@ template <typename FF> class TranscriptTest : public testing::Test {
17
17
/* *
18
18
* @brief Construct a manifest for a standard Honk proof
19
19
*
20
+ * @details This is where we define the "Manifest" for a Standard Honk proof. The tests in this suite are intented
21
+ * to warn the developer if the Prover/Verifier has deviated from this manifest, however, the Transcript class is
22
+ * not otherwise contrained to follow the manifest.
23
+ *
20
24
* @return TranscriptManifest
21
25
*/
22
26
TranscriptManifest construct_standard_honk_manifest (size_t circuit_size)
@@ -53,7 +57,7 @@ template <typename FF> class TranscriptTest : public testing::Test {
53
57
}
54
58
55
59
round++;
56
- manifest_expected.add_entry (round, " multivariate_evaluations " , size_evals);
60
+ manifest_expected.add_entry (round, " Sumcheck:evaluations " , size_evals);
57
61
manifest_expected.add_challenge (round, " rho" );
58
62
59
63
round++;
@@ -86,12 +90,13 @@ using FieldTypes = testing::Types<barretenberg::fr>;
86
90
TYPED_TEST_SUITE (TranscriptTest, FieldTypes);
87
91
88
92
/* *
89
- * @brief Ensure consistency between the manifests generated by the standard honk prover and verfier for a simple
90
- * circuit of size n = 8
93
+ * @brief Ensure consistency between the manifest hard coded in this testing suite and the one generated by the
94
+ * standard honk prover over the course of proof construction.
91
95
*
92
96
*/
93
- TYPED_TEST (TranscriptTest, StandardHonkManifest )
97
+ TYPED_TEST (TranscriptTest, ProverManifestConsistency )
94
98
{
99
+ // Construct a simple circuit of size n = 8 (i.e. the minimum circuit size)
95
100
auto composer = StandardHonkComposer ();
96
101
fr a = 1 ;
97
102
composer.circuit_constructor .add_variable (a);
@@ -101,14 +106,49 @@ TYPED_TEST(TranscriptTest, StandardHonkManifest)
101
106
auto prover = composer.create_prover ();
102
107
plonk::proof proof = prover.construct_proof ();
103
108
104
- // Check that the prover generated manifest agrees with the expectation
109
+ // Check that the prover generated manifest agrees with the manifest hard coded in this suite
105
110
auto manifest_expected = TestFixture::construct_standard_honk_manifest (prover.key ->circuit_size );
106
- ASSERT_EQ ( prover.transcript .get_manifest (), manifest_expected );
111
+ auto prover_manifest = prover.transcript .get_manifest ();
107
112
108
- // If the proof verifies, the verifier manifest must have matched that of the prover
113
+ // Note: a manifest can be printed using manifest.print()
114
+ for (size_t round = 0 ; round < manifest_expected.size (); ++round) {
115
+ ASSERT_EQ (prover_manifest[round], manifest_expected[round]) << " Prover manifest discrepency in round " << round;
116
+ ;
117
+ }
118
+ }
119
+
120
+ /* *
121
+ * @brief Ensure consistency between the manifest generated by the standard honk prover over the course of proof
122
+ * construction and the one generated by the verifier over the course of proof verification.
123
+ *
124
+ */
125
+ TYPED_TEST (TranscriptTest, VerifierManifestConsistency)
126
+ {
127
+ // Construct a simple circuit of size n = 8 (i.e. the minimum circuit size)
128
+ auto composer = StandardHonkComposer ();
129
+ fr a = 1 ;
130
+ composer.circuit_constructor .add_variable (a);
131
+ composer.circuit_constructor .add_public_variable (a);
132
+
133
+ // Automatically generate a transcript manifest in the prover by constructing a proof
134
+ auto prover = composer.create_prover ();
135
+ plonk::proof proof = prover.construct_proof ();
136
+
137
+ // Automatically generate a transcript manifest in the verifier by verifying a proof
109
138
auto verifier = composer.create_verifier ();
110
- bool verified = verifier.verify_proof (proof);
111
- ASSERT_TRUE (verified);
139
+ verifier.verify_proof (proof);
140
+ prover.transcript .print ();
141
+ verifier.transcript .print ();
142
+
143
+ // Check consistency between the manifests generated by the prover and verifier
144
+ auto prover_manifest = prover.transcript .get_manifest ();
145
+ auto verifier_manifest = verifier.transcript .get_manifest ();
146
+
147
+ // Note: a manifest can be printed using manifest.print()
148
+ for (size_t round = 0 ; round < prover_manifest.size (); ++round) {
149
+ ASSERT_EQ (prover_manifest[round], verifier_manifest[round])
150
+ << " Prover/Verifier manifest discrepency in round " << round;
151
+ }
112
152
}
113
153
114
154
/* *
@@ -207,7 +247,7 @@ TYPED_TEST(TranscriptTest, VerifierMistake)
207
247
// but then generate a challenge anyway
208
248
auto verifier_alpha = verifier_transcript.get_challenge (" alpha" );
209
249
210
- // Challenges will not agree and neither will the manifests
250
+ // Challenges will not agree but neither will the manifests
211
251
EXPECT_NE (prover_alpha, verifier_alpha);
212
252
EXPECT_NE (prover_transcript.get_manifest (), verifier_transcript.get_manifest ());
213
253
}
0 commit comments