Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
transcript_manifest.hpp
Go to the documentation of this file.
1// === AUDIT STATUS ===
2// internal: { status: not started, auditors: [], date: YYYY-MM-DD }
3// external_1: { status: not started, auditors: [], date: YYYY-MM-DD }
4// external_2: { status: not started, auditors: [], date: YYYY-MM-DD }
5// =====================
6
7#pragma once
8
10#include <map>
11#include <string>
12#include <vector>
13namespace bb {
14
16 struct RoundData {
17 std::vector<std::string> challenge_label;
19
20 void print()
21 {
22 for (auto& label : challenge_label) {
23 info("\tchallenge: ", label);
24 }
25 for (auto& entry : entries) {
26 info("\telement (", entry.second, "): ", entry.first);
27 }
28 }
29
30 bool operator==(const RoundData& other) const = default;
31 };
32
34
35 public:
36 void print()
37 {
38 for (auto& round : manifest) {
39 info("Round: ", round.first);
40 round.second.print();
41 }
42 }
43
44 template <typename... Strings> void add_challenge(size_t round, Strings&... labels)
45 {
46 manifest[round].challenge_label = { labels... };
47 }
48 template <typename String, size_t NumChallenges>
50 {
51 auto call_add_challenge = [&] {
52 auto call_fn_with_expanded_parameters =
53 [&]<size_t... Indices>([[maybe_unused]] std::index_sequence<Indices...>) {
54 return add_challenge(round, std::get<Indices>(labels)...);
55 };
56 return call_fn_with_expanded_parameters(std::make_index_sequence<NumChallenges>());
57 };
58 call_add_challenge();
59 }
60
61 void add_entry(size_t round, const std::string& element_label, size_t element_size)
62 {
63 manifest[round].entries.emplace_back(element_label, element_size);
64 }
65
66 [[nodiscard]] size_t size() const { return manifest.size(); }
67
68 RoundData operator[](const size_t& round) { return manifest[round]; };
69
70 bool operator==(const TranscriptManifest& other) const = default;
71};
72
73} // namespace bb
RoundData operator[](const size_t &round)
void add_entry(size_t round, const std::string &element_label, size_t element_size)
bool operator==(const TranscriptManifest &other) const =default
std::map< size_t, RoundData > manifest
void add_challenge(size_t round, Strings &... labels)
void add_challenge(size_t round, std::array< String, NumChallenges > labels)
void info(Args... args)
Definition log.hpp:74
Entry point for Barretenberg command-line interface.
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
std::vector< std::string > challenge_label
bool operator==(const RoundData &other) const =default
std::vector< std::pair< std::string, size_t > > entries