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

#include <origin_tag.hpp>

Public Member Functions

 OriginTag ()=default
 
 OriginTag (const OriginTag &other)=default
 
 OriginTag (OriginTag &&other)=default
 
OriginTagoperator= (const OriginTag &other)=default
 
OriginTagoperator= (OriginTag &&other) noexcept
 
 OriginTag (size_t transcript_idx, size_t round_number, bool is_submitted=true)
 Construct a new Origin Tag object.
 
 OriginTag (const OriginTag &tag_a, const OriginTag &tag_b)
 Construct a new Origin Tag by merging two other Origin Tags.
 
template<class... T>
 OriginTag (const OriginTag &tag, const T &... rest)
 Construct a new Origin Tag from merging several origin tags.
 
 ~OriginTag ()=default
 
bool operator== (const OriginTag &other) const
 
void poison ()
 
void unpoison ()
 
bool is_poisoned () const
 
bool is_empty () const
 
bool is_free_witness () const
 
void set_free_witness ()
 
void unset_free_witness ()
 
void clear_round_provenance ()
 Clear the round_provenance to address round provenance false positives.
 

Public Attributes

size_t transcript_index = CONSTANT
 
numeric::uint256_t round_provenance = numeric::uint256_t(0)
 
bool instant_death = false
 

Static Public Attributes

static constexpr size_t CONSTANT = static_cast<size_t>(-1)
 
static constexpr size_t FREE_WITNESS = static_cast<size_t>(-2)
 

Detailed Description

Definition at line 67 of file origin_tag.hpp.

Constructor & Destructor Documentation

◆ OriginTag() [1/6]

bb::OriginTag::OriginTag ( )
default

◆ OriginTag() [2/6]

bb::OriginTag::OriginTag ( const OriginTag other)
default

◆ OriginTag() [3/6]

bb::OriginTag::OriginTag ( OriginTag &&  other)
default

◆ OriginTag() [4/6]

bb::OriginTag::OriginTag ( size_t  transcript_idx,
size_t  round_number,
bool  is_submitted = true 
)
inline

Construct a new Origin Tag object.

Parameters
transcript_idxThe index of the transcript object
round_numberThe round in which we generate/receive the value
is_submittedIf the value is submitted by the prover (not a challenge)

Definition at line 108 of file origin_tag.hpp.

◆ OriginTag() [5/6]

bb::OriginTag::OriginTag ( const OriginTag tag_a,
const OriginTag tag_b 
)

Construct a new Origin Tag by merging two other Origin Tags.

The function checks for 3 things: 1) The no tag has instant death set, 2) That tags are from the same transcript (same transcript_index) or are empty, 3) A complex check for the round_provenance. After that the round_provenance values are merged and we create a new Origin Tag

Parameters
tag_a
tag_b

Definition at line 42 of file origin_tag.cpp.

◆ OriginTag() [6/6]

template<class... T>
bb::OriginTag::OriginTag ( const OriginTag tag,
const T &...  rest 
)
inline

Construct a new Origin Tag from merging several origin tags.

Basically performs the same actions as the constructor from 2 Origin Tags, but iteratively

Template Parameters
T
Parameters
tag
rest

Definition at line 136 of file origin_tag.hpp.

◆ ~OriginTag()

bb::OriginTag::~OriginTag ( )
default

Member Function Documentation

◆ clear_round_provenance()

void bb::OriginTag::clear_round_provenance ( )
inline

Clear the round_provenance to address round provenance false positives.

Definition at line 170 of file origin_tag.hpp.

◆ is_empty()

bool bb::OriginTag::is_empty ( ) const
inline

Definition at line 153 of file origin_tag.hpp.

◆ is_free_witness()

bool bb::OriginTag::is_free_witness ( ) const
inline

Definition at line 155 of file origin_tag.hpp.

◆ is_poisoned()

bool bb::OriginTag::is_poisoned ( ) const
inline

Definition at line 152 of file origin_tag.hpp.

◆ operator=() [1/2]

OriginTag & bb::OriginTag::operator= ( const OriginTag other)
default

◆ operator=() [2/2]

OriginTag & bb::OriginTag::operator= ( OriginTag &&  other)
inlinenoexcept

Definition at line 93 of file origin_tag.hpp.

◆ operator==()

bool bb::OriginTag::operator== ( const OriginTag other) const

Definition at line 37 of file origin_tag.cpp.

◆ poison()

void bb::OriginTag::poison ( )
inline

Definition at line 150 of file origin_tag.hpp.

◆ set_free_witness()

void bb::OriginTag::set_free_witness ( )
inline

Definition at line 156 of file origin_tag.hpp.

◆ unpoison()

void bb::OriginTag::unpoison ( )
inline

Definition at line 151 of file origin_tag.hpp.

◆ unset_free_witness()

void bb::OriginTag::unset_free_witness ( )
inline

Definition at line 161 of file origin_tag.hpp.

Member Data Documentation

◆ CONSTANT

constexpr size_t bb::OriginTag::CONSTANT = static_cast<size_t>(-1)
staticconstexpr

Definition at line 69 of file origin_tag.hpp.

◆ FREE_WITNESS

constexpr size_t bb::OriginTag::FREE_WITNESS = static_cast<size_t>(-2)
staticconstexpr

Definition at line 70 of file origin_tag.hpp.

◆ instant_death

bool bb::OriginTag::instant_death = false

Definition at line 86 of file origin_tag.hpp.

◆ round_provenance

numeric::uint256_t bb::OriginTag::round_provenance = numeric::uint256_t(0)

Definition at line 83 of file origin_tag.hpp.

◆ transcript_index

size_t bb::OriginTag::transcript_index = CONSTANT

Definition at line 77 of file origin_tag.hpp.


The documentation for this struct was generated from the following files: