Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lde/transcript #248

Merged
merged 10 commits into from
Mar 24, 2023
Prev Previous commit
Next Next commit
update verifier trascript to fix wasm build
ledwards2225 authored and codygunton committed Mar 24, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 0df6f441c86f63d1e4649324c16849f29ba37f76
9 changes: 4 additions & 5 deletions cpp/src/barretenberg/honk/transcript/transcript.hpp
Original file line number Diff line number Diff line change
@@ -214,12 +214,11 @@ template <class FF> class VerifierTranscript : public BaseTranscript<FF> {

/// Contains the raw data sent by the prover.
const std::vector<uint8_t> proof_data_;
typename std::vector<uint8_t>::const_iterator read_iterator_;
size_t num_bytes_read_ = 0;
ledwards2225 marked this conversation as resolved.
Show resolved Hide resolved

public:
explicit VerifierTranscript(const std::vector<uint8_t>& proof_data)
: proof_data_(proof_data.begin(), proof_data.end())
, read_iterator_(proof_data_.cbegin())
{}

static VerifierTranscript init_empty(const ProverTranscript<FF>& transcript)
@@ -240,10 +239,10 @@ template <class FF> class VerifierTranscript : public BaseTranscript<FF> {
template <class T> T receive_from_prover(const std::string& label)
{
constexpr size_t element_size = sizeof(T);
ASSERT(read_iterator_ + element_size <= proof_data_.end());
ASSERT(num_bytes_read_ + element_size <= proof_data_.size());

std::span<const uint8_t> element_bytes{ read_iterator_, element_size };
read_iterator_ += element_size;
auto element_bytes = std::span{ proof_data_ }.subspan(num_bytes_read_, element_size);
num_bytes_read_ += element_size;

BaseTranscript<FF>::consume_prover_element_bytes(label, element_bytes);