Struct poseidon_permutation::Instance
source · pub struct Instance<'a, F: PrimeField> { /* private fields */ }Expand description
Represents a generic instance of Poseidon.
Intended for generic fixed-width hashing.
Implementations§
source§impl<'a, F: PrimeField> Instance<'a, F>
impl<'a, F: PrimeField> Instance<'a, F>
sourcepub fn new(parameters: &'a PoseidonParameters<F>) -> Self
pub fn new(parameters: &'a PoseidonParameters<F>) -> Self
Instantiate a new hash function over GF(p) given Parameters.
sourcepub fn n_to_1_fixed_hash(&mut self, input_words: Vec<F>) -> F
pub fn n_to_1_fixed_hash(&mut self, input_words: Vec<F>) -> F
Fixed width hash from n:1. Outputs a F given t input words.
sourcepub fn output_words(&self) -> Vec<F>
pub fn output_words(&self) -> Vec<F>
Print out internal state.
sourcepub fn unoptimized_n_to_1_fixed_hash(&mut self, input_words: Vec<F>) -> F
pub fn unoptimized_n_to_1_fixed_hash(&mut self, input_words: Vec<F>) -> F
Fixed width hash from n:1. Outputs a F given t input words. Unoptimized.