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#pragma once
2
4#include <array>
5#include <map>
6#include <span>
7#include <string>
8#include <vector>
9
10namespace bb {
11
13 struct RoundData {
14 std::vector<std::string> challenge_label;
16
17 void print()
18 {
19 for (auto& label : challenge_label) {
20 info("\tchallenge: ", label);
21 }
22 for (auto& entry : entries) {
23 info("\telement (", entry.second, "): ", entry.first);
24 }
25 }
26
27 bool operator==(const RoundData& other) const = default;
28 };
29
31
32 public:
33 void print()
34 {
35 for (auto& round : manifest) {
36 info("Round: ", round.first);
37 round.second.print();
38 }
39 }
40
45 void add_challenge(size_t round, const std::string& label) { manifest[round].challenge_label.push_back(label); }
46
52 {
53 for (const auto& label : labels) {
54 add_challenge(round, label);
55 }
56 }
57
62 template <size_t N> void add_challenge(size_t round, const std::array<std::string, N>& labels)
63 {
64 add_challenge(round, std::span<const std::string>{ labels.data(), labels.size() });
65 }
66
71 template <size_t N> void add_challenge(size_t round, const std::array<const char*, N>& labels)
72 {
73 for (const auto& label : labels) {
74 add_challenge(round, std::string(label));
75 }
76 }
77
78 void add_entry(size_t round, const std::string& element_label, size_t element_size)
79 {
80 manifest[round].entries.emplace_back(element_label, element_size);
81 }
82
83 [[nodiscard]] size_t size() const { return manifest.size(); }
84
85 RoundData operator[](const size_t& round) { return manifest[round]; };
86
87 bool operator==(const TranscriptManifest& other) const = default;
88};
89
90} // 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:89
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