barretenberg
Loading...
Searching...
No Matches
manifest.hpp
1#pragma once
2#include <string>
3#include <vector>
4
5namespace transcript {
11class Manifest {
12 public:
18 std::string name;
19 size_t num_bytes;
20 bool derived_by_verifier;
21 int challenge_map_index = 0;
22 };
23
29
37 RoundManifest(std::vector<ManifestEntry> element_names,
38 const std::string challenge_name,
39 const size_t num_challenges_in,
40 bool map_challenges_in = false)
41 : elements(element_names)
42 , challenge(challenge_name)
43 , num_challenges(num_challenges_in)
44 , map_challenges(map_challenges_in)
45 {}
46
54 bool includes_element(const std::string& element_name)
55 {
56 for (const auto& ele : elements) {
57 if (element_name == ele.name) {
58 return true;
59 }
60 }
61 return false;
62 }
63
64 std::vector<ManifestEntry> elements;
65 std::string challenge;
66 size_t num_challenges;
67 bool map_challenges;
68 };
69
70 Manifest() = default;
71 Manifest(std::vector<RoundManifest> _round_manifests)
72 : round_manifests(_round_manifests)
73 , num_rounds(round_manifests.size()){};
74
75 size_t get_num_rounds() const { return num_rounds; }
76
77 RoundManifest get_round_manifest(const size_t idx) const { return round_manifests[idx]; }
78
79 std::vector<RoundManifest> get_round_manifests() const { return round_manifests; }
80
81 private:
82 std::vector<RoundManifest> round_manifests;
83 size_t num_rounds;
84}; // namespace transcript
85} // namespace transcript
Definition: manifest.hpp:11
Definition: manifest.hpp:17
Definition: manifest.hpp:28
RoundManifest(std::vector< ManifestEntry > element_names, const std::string challenge_name, const size_t num_challenges_in, bool map_challenges_in=false)
Definition: manifest.hpp:37
bool includes_element(const std::string &element_name)
Definition: manifest.hpp:54