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 <array>
11#include <map>
12#include <span>
13#include <string>
14#include <vector>
15
16namespace bb {
17
19 struct RoundData {
20 std::vector<std::string> challenge_label;
22
23 void print()
24 {
25 for (auto& label : challenge_label) {
26 info("\tchallenge: ", label);
27 }
28 for (auto& entry : entries) {
29 info("\telement (", entry.second, "): ", entry.first);
30 }
31 }
32
33 bool operator==(const RoundData& other) const = default;
34 };
35
37
38 public:
39 void print()
40 {
41 for (auto& round : manifest) {
42 info("Round: ", round.first);
43 round.second.print();
44 }
45 }
46
51 void add_challenge(size_t round, const std::string& label) { manifest[round].challenge_label.push_back(label); }
52
58 {
59 for (const auto& label : labels) {
60 add_challenge(round, label);
61 }
62 }
63
68 template <size_t N> void add_challenge(size_t round, const std::array<std::string, N>& labels)
69 {
70 add_challenge(round, std::span<const std::string>{ labels.data(), labels.size() });
71 }
72
77 template <size_t N> void add_challenge(size_t round, const std::array<const char*, N>& labels)
78 {
79 for (const auto& label : labels) {
80 add_challenge(round, std::string(label));
81 }
82 }
83
84 void add_entry(size_t round, const std::string& element_label, size_t element_size)
85 {
86 manifest[round].entries.emplace_back(element_label, element_size);
87 }
88
89 [[nodiscard]] size_t size() const { return manifest.size(); }
90
91 RoundData operator[](const size_t& round) { return manifest[round]; };
92
93 bool operator==(const TranscriptManifest& other) const = default;
94};
95
96} // namespace bb
void add_challenge(size_t round, const std::array< std::string, N > &labels)
Add multiple challenge labels to the manifest for the given round.
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, std::span< const std::string > labels)
Add multiple challenge labels to the manifest for the given round.
void add_challenge(size_t round, const std::string &label)
Add a single challenge label to the manifest for the given round.
void add_challenge(size_t round, const std::array< const char *, N > &labels)
Add multiple challenge labels to the manifest for the given round.
void info(Args... args)
Definition log.hpp:75
Entry point for Barretenberg command-line interface.
Definition api.hpp:5
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