barretenberg
Loading...
Searching...
No Matches
nullifier_memory_tree.hpp
1#pragma once
2#include "../hash.hpp"
3#include "../memory_tree.hpp"
4#include "nullifier_leaf.hpp"
5
6namespace proof_system::plonk {
7namespace stdlib {
8namespace merkle_tree {
9
10using namespace barretenberg;
11
71
72 public:
73 NullifierMemoryTree(size_t depth);
74
75 using MemoryTree::get_hash_path;
76 using MemoryTree::root;
77 using MemoryTree::update_element;
78
79 fr update_element(fr const& value);
80
81 const std::vector<barretenberg::fr>& get_hashes() { return hashes_; }
82 const WrappedNullifierLeaf get_leaf(size_t index)
83 {
84 return (index < leaves_.size()) ? leaves_[index] : WrappedNullifierLeaf::zero();
85 }
86 const std::vector<WrappedNullifierLeaf>& get_leaves() { return leaves_; }
87
88 protected:
89 using MemoryTree::depth_;
90 using MemoryTree::hashes_;
91 using MemoryTree::root_;
92 using MemoryTree::total_size_;
93 std::vector<WrappedNullifierLeaf> leaves_;
94};
95
96} // namespace merkle_tree
97} // namespace stdlib
98} // namespace proof_system::plonk
Wrapper for the Nullifier leaf class that allows for 0 values.
Definition: nullifier_leaf.hpp:34
static WrappedNullifierLeaf zero()
Generate a zero leaf (call the constructor with no arguments)
Definition: nullifier_leaf.hpp:82
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