13using namespace numeric;
14#ifndef AZTEC_NO_ORIGIN_TAGS
26 for (
int idx = 0; idx < 4; idx++) {
27 auto chunk =
static_cast<uint64_t
>(
value >> (64 * (3 - idx)));
29 return 255 - (idx * 64) - __builtin_clzll(chunk);
58 if (submitted_a == 0 || submitted_b == 0 || submitted_a == submitted_b) {
63 const int max_challenge_round = highest_set_bit_256(provenance_a.
hi | provenance_b.
hi);
64 const int max_submitted_round = highest_set_bit_256(submitted_a | submitted_b);
66 if (max_challenge_round < max_submitted_round) {
68 ") < max submitted round (" +
std::to_string(max_submitted_round) +
")");
81 throw_or_abort(
"Touched an element that should not have been touched. tag_a id: " +
99 ") should not interact with an element that has an origin (id: " +
std::to_string(tag_b.
tag_id) +
")");
110 ") should not interact with an element that has an origin (id: " +
std::to_string(tag_a.
tag_id) +
")");
119 throw_or_abort(
"Tags from different transcripts were involved in the same computation. tag_a: { id: " +
Entry point for Barretenberg command-line interface.
void check_round_provenance(const uint512_t &provenance_a, const uint512_t &provenance_b)
Detect if two elements from the same transcript are performing a suspicious interaction.
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...
static constexpr size_t CONSTANT
numeric::uint512_t round_provenance
bool is_free_witness() const
bool operator==(const OriginTag &other) const
void throw_or_abort(std::string const &err)