42 fr get_node(uint32_t level,
size_t index)
const;
51template <
typename HashingPolicy>
65 for (
size_t i = 0; i < layer_size; ++i) {
68 current = HashingPolicy::hash_pair(current, current);
77 for (
size_t i = depth_; i > level; i--) {
80 return hashes_[
offset + index];
87 size_t layer_size = total_size_;
88 for (
size_t i = 0; i < depth_; ++i) {
102 size_t layer_size = total_size_;
103 for (
size_t i = 0; i < depth_; i++) {
104 if (index % 2 == 0) {
105 path[i] = hashes_[
offset + index + 1];
107 path[i] = hashes_[
offset + index - 1];
119 size_t layer_size = total_size_;
121 for (
size_t i = 0; i < depth_; ++i) {
122 hashes_[
offset + index] = current;
123 index &= (~0ULL) - 1;
124 current = HashingPolicy::hash_pair(hashes_[
offset + index], hashes_[
offset + index + 1]);
#define BB_ASSERT_GTE(left, right,...)
#define BB_ASSERT_LTE(left, right,...)
fr update_element(size_t index, fr const &value)
fr_hash_path get_hash_path(size_t index) const
fr get_node(uint32_t level, size_t index) const
fr_sibling_path get_sibling_path(size_t index) const
std::vector< bb::fr > hashes_
std::vector< std::pair< fr, fr > > fr_hash_path
std::vector< fr > fr_sibling_path
field< Bn254FrParams > fr
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept