@@ -205,7 +205,7 @@ class NativeVerificationKey_ : public PrecomputedCommitments {
205205 }
206206
207207 /* *
208- * @brief Adds the verification key hash to the transcript and returns the hash.
208+ * @brief Hashes the vk using the transcript's independent buffer and returns the hash.
209209 * @details Needed to make sure the Origin Tag system works. We need to set the origin tags of the VK witnesses in
210210 * the transcript. If we instead did the hashing outside of the transcript and submitted just the hash, only the
211211 * origin tag of the hash would be set properly. We want to avoid backpropagating origin tags to the actual VK
@@ -216,7 +216,8 @@ class NativeVerificationKey_ : public PrecomputedCommitments {
216216 * @param transcript
217217 * @returns The hash of the verification key
218218 */
219- virtual fr add_hash_to_transcript (const std::string& domain_separator, Transcript& transcript) const
219+ virtual typename Transcript::DataType hash_through_transcript (const std::string& domain_separator,
220+ Transcript& transcript) const
220221 {
221222 transcript.add_to_independent_hash_buffer (domain_separator + " vk_log_circuit_size" , this ->log_circuit_size );
222223 transcript.add_to_independent_hash_buffer (domain_separator + " vk_num_public_inputs" , this ->num_public_inputs );
@@ -226,10 +227,8 @@ class NativeVerificationKey_ : public PrecomputedCommitments {
226227 transcript.add_to_independent_hash_buffer (domain_separator + " vk_commitment" , commitment);
227228 }
228229
229- fr vk_hash = transcript.hash_independent_buffer ();
230- transcript.add_to_hash_buffer (domain_separator + " vk_hash" , vk_hash);
231- return vk_hash;
232- };
230+ return transcript.hash_independent_buffer ();
231+ }
233232};
234233
235234/* *
@@ -299,7 +298,7 @@ class StdlibVerificationKey_ : public PrecomputedCommitments {
299298 }
300299
301300 /* *
302- * @brief Adds the verification key hash to the transcript and returns the hash.
301+ * @brief Hashes the vk using the transcript's independent buffer and returns the hash.
303302 * @details Needed to make sure the Origin Tag system works. We need to set the origin tags of the VK witnesses in
304303 * the transcript. If we instead did the hashing outside of the transcript and submitted just the hash, only the
305304 * origin tag of the hash would be set properly. We want to avoid backpropagating origin tags to the actual VK
@@ -310,18 +309,16 @@ class StdlibVerificationKey_ : public PrecomputedCommitments {
310309 * @param transcript
311310 * @returns The hash of the verification key
312311 */
313- virtual FF add_hash_to_transcript (const std::string& domain_separator, Transcript& transcript) const
312+ virtual FF hash_through_transcript (const std::string& domain_separator, Transcript& transcript) const
314313 {
315314 transcript.add_to_independent_hash_buffer (domain_separator + " vk_log_circuit_size" , this ->log_circuit_size );
316315 transcript.add_to_independent_hash_buffer (domain_separator + " vk_num_public_inputs" , this ->num_public_inputs );
317316 transcript.add_to_independent_hash_buffer (domain_separator + " vk_pub_inputs_offset" , this ->pub_inputs_offset );
318317 for (const Commitment& commitment : this ->get_all ()) {
319318 transcript.add_to_independent_hash_buffer (domain_separator + " vk_commitment" , commitment);
320319 }
321- FF vk_hash = transcript.hash_independent_buffer ();
322- transcript.add_to_hash_buffer (domain_separator + " vk_hash" , vk_hash);
323- return vk_hash;
324- };
320+ return transcript.hash_independent_buffer ();
321+ }
325322};
326323
327324template <typename FF, typename VerificationKey> class VKAndHash_ {
0 commit comments