|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
Implements a cryptographic sponge over prime fields. Implements the sponge specification from the Community Cryptographic Specification Project see https://github.com/C2SP/C2SP/blob/792c1254124f625d459bfe34417e8f6bdd02eb28/poseidon-sponge.md (Note: this spec was not accepted into the C2SP repo, we might want to reference something else!) More...
#include <sponge.hpp>
Static Public Member Functions | |
| static FF | hash_internal (std::span< const FF > input) |
| Use the sponge to hash an input vector. | |
| static FF | hash_internal (std::span< const FF > input, FF iv) |
| Use the sponge to hash an input vector with a custom IV. | |
Private Member Functions | |
| FieldSponge (FF domain_iv) | |
| void | perform_duplex () |
| void | absorb (const FF &input) |
| FF | squeeze () |
Private Attributes | |
| std::array< FF, t > | state {} |
| std::array< FF, rate > | cache {} |
| size_t | cache_size = 0 |
Implements a cryptographic sponge over prime fields. Implements the sponge specification from the Community Cryptographic Specification Project see https://github.com/C2SP/C2SP/blob/792c1254124f625d459bfe34417e8f6bdd02eb28/poseidon-sponge.md (Note: this spec was not accepted into the C2SP repo, we might want to reference something else!)
Note: If we ever use this sponge class for more than 1 hash functions, we should move this out of poseidon2 and into its own directory
| FF | |
| rate | |
| capacity | |
| t | |
| Permutation |
Definition at line 32 of file sponge.hpp.
|
inlineprivate |
Definition at line 41 of file sponge.hpp.
|
inlineprivate |
Definition at line 57 of file sponge.hpp.
|
inlinestatic |
Use the sponge to hash an input vector.
| input | Field elements (a_0, ..., a_{N-1}) |
Definition at line 84 of file sponge.hpp.
|
inlinestatic |
Use the sponge to hash an input vector with a custom IV.
| input | Field elements (a_0, ..., a_{N-1}) |
| iv | Initial value for domain separation |
Definition at line 98 of file sponge.hpp.
|
inlineprivate |
Definition at line 43 of file sponge.hpp.
|
inlineprivate |
Definition at line 71 of file sponge.hpp.
|
private |
Definition at line 38 of file sponge.hpp.
|
private |
Definition at line 39 of file sponge.hpp.
|
private |
Definition at line 35 of file sponge.hpp.