14using namespace numeric;
15#ifndef AZTEC_NO_ORIGIN_TAGS
28 auto high =
static_cast<uint64_t
>(
value >> 64);
30 return 127 - __builtin_clzll(high);
33 auto low =
static_cast<uint64_t
>(
value);
34 return 63 - __builtin_clzll(low);
66 const auto submitted_a = extract_uint128(&provenance_a.
data[0]);
67 const auto submitted_b = extract_uint128(&provenance_b.
data[0]);
70 if (submitted_a == 0 || submitted_b == 0 || submitted_a == submitted_b) {
75 const auto challenges_a = extract_uint128(&provenance_a.
data[2]);
76 const auto challenges_b = extract_uint128(&provenance_b.
data[2]);
77 const int max_challenge_round = highest_set_bit_128(challenges_a | challenges_b);
78 const int max_submitted_round = highest_set_bit_128(submitted_a | submitted_b);
80 if (max_challenge_round < max_submitted_round) {
82 ") < max submitted round (" +
std::to_string(max_submitted_round) +
")");
95 throw_or_abort(
"Touched an element that should not have been touched. tag_a id: " +
113 ") should not interact with an element that has an origin (id: " +
std::to_string(tag_b.
tag_id) +
")");
124 ") should not interact with an element that has an origin (id: " +
std::to_string(tag_a.
tag_id) +
")");
133 throw_or_abort(
"Tags from different transcripts were involved in the same computation. tag_a: { id: " +
const std::vector< MemoryValue > data
Entry point for Barretenberg command-line interface.
void 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.
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
std::string to_string(bb::avm2::ValueTag tag)
This file contains part of the logic for the Origin Tag mechanism that tracks the use of in-circuit p...
unsigned __int128 uint128_t
static constexpr size_t CONSTANT
bool is_free_witness() const
numeric::uint256_t round_provenance
bool operator==(const OriginTag &other) const
void throw_or_abort(std::string const &err)