Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
origin_tag.hpp File Reference

This file contains part of the logic for the Origin Tag mechanism that tracks the use of in-circuit primitives through tainting (common term meaning adding information that allows to track value origins) them. It then allows us to detect dangerous behaviours in-circuit. The mechanism is only enabled in DEBUG builds. More...

#include "barretenberg/common/assert.hpp"
#include "barretenberg/common/throw_or_abort.hpp"
#include "barretenberg/numeric/uint256/uint256.hpp"
#include <cstddef>
#include <iterator>
#include <ostream>
#include <type_traits>
#include <vector>

Go to the source code of this file.

Classes

struct  is_iterable< T, typename >
 
struct  is_iterable< T, std::void_t< decltype(std::begin(std::declval< T & >())), decltype(std::end(std::declval< T & >()))> >
 
struct  bb::OriginTag
 

Namespaces

namespace  bb
 Entry point for Barretenberg command-line interface.
 

Concepts

concept  usesTag
 

Macros

#define STANDARD_TESTING_TAGS
 

Functions

void bb::check_round_provenance (const uint256_t &provenance_a, const uint256_t &provenance_b)
 Detect if two elements from the same transcript are performing a suspicious interaction.
 
std::ostream & bb::operator<< (std::ostream &os, OriginTag const &v)
 
template<bool in_circuit, typename T >
void bb::assign_origin_tag (T &elem, const OriginTag &tag)
 Assigns an origin tag to an element or all elements in an iterable container.
 
template<bool in_circuit, typename T >
void bb::check_origin_tag (T &elem, const OriginTag &tag)
 Checks that an element or all elements in an iterable container have the expected origin tag.
 
template<bool in_circuit, typename DataType >
void bb::unset_free_witness_tags (std::vector< DataType > &input)
 Unsets free witness tags on all elements in a vector.
 
template<bool in_circuit, typename Codec , typename T >
std::vector< typename Codec::DataType > bb::tag_and_serialize (const T &component, const OriginTag &tag)
 Tag a component with a given origin tag and serialize it to field elements.
 
template<typename TranscriptType >
OriginTag bb::extract_transcript_tag (const TranscriptType &transcript)
 Extract origin tag context from a transcript.
 

Variables

template<typename T >
constexpr bool is_iterable_v = is_iterable<T>::value
 

Detailed Description

This file contains part of the logic for the Origin Tag mechanism that tracks the use of in-circuit primitives through tainting (common term meaning adding information that allows to track value origins) them. It then allows us to detect dangerous behaviours in-circuit. The mechanism is only enabled in DEBUG builds.

Author
Rumata888

Definition in file origin_tag.hpp.

Macro Definition Documentation

◆ STANDARD_TESTING_TAGS

#define STANDARD_TESTING_TAGS

Definition at line 35 of file origin_tag.hpp.

Variable Documentation

◆ is_iterable_v

template<typename T >
constexpr bool is_iterable_v = is_iterable<T>::value
constexpr

Definition at line 33 of file origin_tag.hpp.