Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
poseidon2.hpp
Go to the documentation of this file.
1
// === AUDIT STATUS ===
2
// internal: { status: not started, auditors: [], date: YYYY-MM-DD }
3
// external_1: { status: not started, auditors: [], date: YYYY-MM-DD }
4
// external_2: { status: not started, auditors: [], date: YYYY-MM-DD }
5
// =====================
6
7
#pragma once
8
9
#include "
poseidon2_params.hpp
"
10
#include "
poseidon2_permutation.hpp
"
11
#include "sponge/sponge.hpp"
12
13
namespace
bb::crypto
{
14
15
template
<
typename
Params>
class
Poseidon2
{
16
public
:
17
using
FF
=
typename
Params::FF
;
18
19
// We choose our rate to be t-1 and capacity to be 1.
20
using
Sponge
=
FieldSponge
<
FF
,
Params::t
- 1, 1,
Params::t
,
Poseidon2Permutation<Params>
>;
21
25
static
FF
hash
(
const
std::vector<FF>& input);
26
};
27
28
extern
template
class
Poseidon2<Poseidon2Bn254ScalarFieldParams>
;
29
}
// namespace bb::crypto
bb::crypto::FieldSponge
Implements a cryptographic sponge over prime fields. Implements the sponge specification from the Com...
Definition
sponge.hpp:32
bb::crypto::Poseidon2
Definition
poseidon2.hpp:15
bb::crypto::Poseidon2::FF
typename Params::FF FF
Definition
poseidon2.hpp:17
bb::crypto::Poseidon2::hash
static FF hash(const std::vector< FF > &input)
Hashes a vector of field elements.
bb::crypto::Poseidon2Permutation
Applies the Poseidon2 permutation function from https://eprint.iacr.org/2023/323 ....
Definition
poseidon2_permutation.hpp:25
bb::crypto
Definition
aes128.cpp:158
poseidon2_params.hpp
poseidon2_permutation.hpp
bb::crypto::Poseidon2Bn254ScalarFieldParams::t
static constexpr size_t t
Definition
poseidon2_params.hpp:19
bb::crypto::Poseidon2Bn254ScalarFieldParams::FF
bb::fr FF
Definition
poseidon2_params.hpp:18
src
barretenberg
crypto
poseidon2
poseidon2.hpp
Generated by
1.9.8