Skip to content

Commit

Permalink
Added note on pre-hashing.
Browse files Browse the repository at this point in the history
  • Loading branch information
codygunton committed Mar 24, 2023
1 parent 662fa6d commit 91c9b66
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cpp/src/barretenberg/honk/transcript/transcript.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,10 @@ template <typename FF> class BaseTranscript {
}
full_buffer.insert(full_buffer.end(), current_round_data.begin(), current_round_data.end());

// Optionally pre-hash the full buffer to minimize the amount of data passed to the cryptographic hash function.
// Pre-hash the full buffer to minimize the amount of data passed to the cryptographic hash function.
// Only a collision-resistant hash-function like Pedersen is required for this step.
// Note: this pre-hashing is an efficiency trick that may be discareded if using a SNARK-friendly or in contexts
// (eg smart contract verification) where the cost of elliptic curve operations is high.
std::vector<uint8_t> compressed_buffer = to_buffer(crypto::pedersen::compress_native(full_buffer));

// Use a strong hash function to derive the new challenge_buffer.
Expand Down

0 comments on commit 91c9b66

Please sign in to comment.