Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::MockTranscript Class Reference

Mock transcript class used by IPA tests and fuzzer. More...

#include <mock_transcript.hpp>

Public Member Functions

void initialize (std::vector< uint256_t > challenges_, std::vector< bb::curve::Grumpkin::AffineElement > group_elements_={}, std::vector< uint256_t > field_elements_={})
 Initialize the transcript (requires to submit the challenges)
 
void reset_indices ()
 Reset the indices of elements sampled after using the transcript with the prover.
 
template<typename T >
void send_to_verifier (const std::string &, const T &element)
 Send something that can be converted to uint256_t to the verifier (used for field elements)
 
template<typename T >
void add_to_hash_buffer (const std::string &, const T &element)
 Add something to the hash buffer(s).
 
template<typename T >
get_challenge (const std::string &)
 Get a challenge from the verifier.
 
template<typename T >
receive_from_prover (const std::string &)
 Receive elements from the prover.
 

Public Attributes

std::vector< uint256_tchallenges
 
std::vector< bb::curve::Grumpkin::AffineElementgroup_elements
 
std::vector< uint256_tfield_elements
 
std::vector< bb::curve::Grumpkin::AffineElementhash_buffer_group_elements
 
std::vector< uint256_thash_buffer_field_elements
 
size_t current_challenge_index = 0
 
size_t current_field_index = 0
 
size_t current_group_index = 0
 

Detailed Description

Mock transcript class used by IPA tests and fuzzer.

This transcript can send previously determined challenges instead of ones generated by Fiat Shamir. It can also store elements received from the prover. It also has symbolic hash buffers. (The hash buffers exist only because ipa uses them, as they are methods for the Transcript class.)

Definition at line 19 of file mock_transcript.hpp.

Member Function Documentation

◆ add_to_hash_buffer()

template<typename T >
void bb::MockTranscript::add_to_hash_buffer ( const std::string &  ,
const T &  element 
)
inline

Add something to the hash buffer(s).

Definition at line 87 of file mock_transcript.hpp.

◆ get_challenge()

template<typename T >
T bb::MockTranscript::get_challenge ( const std::string &  )
inline

Get a challenge from the verifier.

Definition at line 100 of file mock_transcript.hpp.

◆ initialize()

void bb::MockTranscript::initialize ( std::vector< uint256_t challenges_,
std::vector< bb::curve::Grumpkin::AffineElement group_elements_ = {},
std::vector< uint256_t field_elements_ = {} 
)
inline

Initialize the transcript (requires to submit the challenges)

Parameters
challenges_Challenges that will be sent to the prover/verifier
group_elements_Group elements sent to the verifier
field_elements_Field elements sent to the verifier

Definition at line 45 of file mock_transcript.hpp.

◆ receive_from_prover()

template<typename T >
T bb::MockTranscript::receive_from_prover ( const std::string &  )
inline

Receive elements from the prover.

Definition at line 112 of file mock_transcript.hpp.

◆ reset_indices()

void bb::MockTranscript::reset_indices ( )
inline

Reset the indices of elements sampled after using the transcript with the prover.

After the transcipt received elements from the prover, this method allows to reset counters so that the verifier can receive those elements

Definition at line 62 of file mock_transcript.hpp.

◆ send_to_verifier()

template<typename T >
void bb::MockTranscript::send_to_verifier ( const std::string &  ,
const T &  element 
)
inline

Send something that can be converted to uint256_t to the verifier (used for field elements)

Definition at line 72 of file mock_transcript.hpp.

Member Data Documentation

◆ challenges

std::vector<uint256_t> bb::MockTranscript::challenges

Definition at line 22 of file mock_transcript.hpp.

◆ current_challenge_index

size_t bb::MockTranscript::current_challenge_index = 0

Definition at line 34 of file mock_transcript.hpp.

◆ current_field_index

size_t bb::MockTranscript::current_field_index = 0

Definition at line 35 of file mock_transcript.hpp.

◆ current_group_index

size_t bb::MockTranscript::current_group_index = 0

Definition at line 36 of file mock_transcript.hpp.

◆ field_elements

std::vector<uint256_t> bb::MockTranscript::field_elements

Definition at line 26 of file mock_transcript.hpp.

◆ group_elements

std::vector<bb::curve::Grumpkin::AffineElement> bb::MockTranscript::group_elements

Definition at line 24 of file mock_transcript.hpp.

◆ hash_buffer_field_elements

std::vector<uint256_t> bb::MockTranscript::hash_buffer_field_elements

Definition at line 31 of file mock_transcript.hpp.

◆ hash_buffer_group_elements

std::vector<bb::curve::Grumpkin::AffineElement> bb::MockTranscript::hash_buffer_group_elements

Definition at line 29 of file mock_transcript.hpp.


The documentation for this class was generated from the following file: