Expand description
An implementation of Poseidon2 targeting the Baby Bear.
Structs§
- Poseidon2
Hash Suite - A hash suite using Poseidon2 for both MT hashes and RNG
- Poseidon2
Rng - A random number generator driven by Poseidon2
Constants§
- CELLS
- The number of state elements (also known as “cells”) used in the Poseidon2 hash function.
- CELLS_
OUT - The size of the hash output in cells (~ 248 bits)
- CELLS_
RATE - The ‘rate’ of the sponge, i.e. how much we can safely add/remove per mixing.
- M_
INT_ DIAG_ HZN - Standardizing on the same coefficients as https://github.com/HorizenLabs/poseidon2.git (as used in its plain implementation of Poseidon2 for BabyBear)
- ROUNDS_
HALF_ FULL - The number of full S-box rounds in the first and last half of the Poseidon2 permutation.
- ROUNDS_
PARTIAL - The number of partial S-box rounds in the middle of the Poseidon2 permutation.
- ROUND_
CONSTANTS - Round constants used in the Poseidon2 permutation.
Functions§
- poseidon2_
mix - The raw sponge mixing function
- unpadded_
hash - Perform an unpadded hash of a vector of elements. Because this is unpadded collision resistance is only true for vectors of the same size. If the size is variable, this is subject to length extension attacks.