|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
Implements the circuit form of a cryptographic sponge over prime fields. More...
#include <sponge.hpp>
Static Public Member Functions | |
| static field_t | hash_internal (std::span< const field_t > input) |
| Use the sponge to hash an input vector. | |
Private Types | |
| using | Permutation = Poseidon2Permutation< Builder > |
| using | field_t = stdlib::field_t< Builder > |
Private Member Functions | |
| FieldSponge (Builder *builder_, size_t in_len) | |
| void | perform_duplex () |
| void | absorb (const field_t &input) |
| field_t | squeeze () |
Private Attributes | |
| std::array< field_t, t > | state {} |
| std::array< field_t, rate > | cache {} |
| size_t | cache_size = 0 |
| Builder * | builder |
Static Private Attributes | |
| static constexpr size_t | t = crypto::Poseidon2Bn254ScalarFieldParams::t |
| static constexpr size_t | capacity = 1 |
| static constexpr size_t | rate = t - capacity |
Implements the circuit form of a cryptographic sponge over prime fields.
| Builder | A circuit builder class. Can be Ultra- or MegaCircuitBuilder. |
Definition at line 24 of file sponge.hpp.
|
private |
Definition at line 31 of file sponge.hpp.
|
private |
Definition at line 26 of file sponge.hpp.
|
inlineprivate |
Definition at line 41 of file sponge.hpp.
|
inlineprivate |
Definition at line 64 of file sponge.hpp.
|
inlinestatic |
Use the sponge to hash an input vector.
| input | Circuit witnesses (a_0, ..., a_{N-1}) |
Definition at line 93 of file sponge.hpp.
|
inlineprivate |
Definition at line 50 of file sponge.hpp.
|
inlineprivate |
Definition at line 78 of file sponge.hpp.
|
private |
Definition at line 39 of file sponge.hpp.
|
private |
Definition at line 37 of file sponge.hpp.
|
private |
Definition at line 38 of file sponge.hpp.
|
staticconstexprprivate |
Definition at line 28 of file sponge.hpp.
|
staticconstexprprivate |
Definition at line 29 of file sponge.hpp.
|
private |
Definition at line 34 of file sponge.hpp.
|
staticconstexprprivate |
Definition at line 27 of file sponge.hpp.