Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
hash.hpp
Go to the documentation of this file.
1
// === AUDIT STATUS ===
2
// internal: { status: Planned, auditors: [], commit: }
3
// external_1: { status: not started, auditors: [], commit: }
4
// external_2: { status: not started, auditors: [], commit: }
5
// =====================
6
7
#pragma once
8
#include "
barretenberg/crypto/poseidon2/poseidon2.hpp
"
9
#include <vector>
10
11
namespace
bb::crypto::merkle_tree
{
12
13
struct
Poseidon2HashPolicy
{
14
static
fr
hash
(
const
std::vector<fr>&
inputs
)
15
{
16
return
bb::crypto::Poseidon2<bb::crypto::Poseidon2Bn254ScalarFieldParams>::hash
(
inputs
);
17
}
18
19
static
fr
hash_pair
(
const
fr
& lhs,
const
fr
& rhs) {
return
hash
(std::vector<fr>({ lhs, rhs })); }
20
21
static
fr
zero_hash
() {
return
fr::zero
(); }
22
};
23
24
}
// namespace bb::crypto::merkle_tree
bb::crypto::Poseidon2::hash
static FF hash(const std::vector< FF > &input)
Hashes a vector of field elements.
poseidon2.hpp
inputs
AvmProvingInputs inputs
Definition
hinting_dbs.test.cpp:45
bb::crypto::merkle_tree
Definition
content_addressed_append_only_tree.hpp:33
bb::crypto::merkle_tree::Poseidon2HashPolicy
Definition
hash.hpp:13
bb::crypto::merkle_tree::Poseidon2HashPolicy::hash_pair
static fr hash_pair(const fr &lhs, const fr &rhs)
Definition
hash.hpp:19
bb::crypto::merkle_tree::Poseidon2HashPolicy::zero_hash
static fr zero_hash()
Definition
hash.hpp:21
bb::crypto::merkle_tree::Poseidon2HashPolicy::hash
static fr hash(const std::vector< fr > &inputs)
Definition
hash.hpp:14
bb::field< Bn254FrParams >
bb::field< Bn254FrParams >::zero
static constexpr field zero()
Definition
field_declarations.hpp:277
src
barretenberg
crypto
merkle_tree
hash.hpp
Generated by
1.9.8