barretenberg
Loading...
Searching...
No Matches
nullifier_tree.hpp
1#pragma once
2#include "../hash.hpp"
3#include "../merkle_tree.hpp"
4#include "nullifier_leaf.hpp"
5
6namespace proof_system::plonk {
7namespace stdlib {
8namespace merkle_tree {
9
10using namespace barretenberg;
11
12template <typename Store> class NullifierTree : public MerkleTree<Store> {
13 public:
14 typedef uint256_t index_t;
15
16 NullifierTree(Store& store, size_t depth, uint8_t tree_id = 0);
17 NullifierTree(NullifierTree const& other) = delete;
20
21 using MerkleTree<Store>::get_hash_path;
22 using MerkleTree<Store>::root;
23 using MerkleTree<Store>::size;
24 using MerkleTree<Store>::depth;
25
26 fr update_element(fr const& value);
27
28 private:
29 using MerkleTree<Store>::update_element;
30 using MerkleTree<Store>::get_element;
32
33 private:
34 using MerkleTree<Store>::store_;
35 using MerkleTree<Store>::zero_hashes_;
36 using MerkleTree<Store>::depth_;
37 using MerkleTree<Store>::tree_id_;
38 std::vector<WrappedNullifierLeaf> leaves;
39};
40
41extern template class NullifierTree<MemoryStore>;
42
43} // namespace merkle_tree
44} // namespace stdlib
45} // namespace proof_system::plonk
Definition: uint256.hpp:25
fr compute_zero_path_hash(size_t height, index_t index, fr const &value)
Definition: merkle_tree.cpp:313
constexpr_utils defines some helper methods that perform some stl-equivalent operations but in a cons...
Definition: constexpr_utils.hpp:16
Definition: widget.bench.cpp:13