Struct poseidon377::Instance
source · pub struct Instance<'a, F>where
F: PrimeField,{ /* private fields */ }
Expand description
Represents a generic instance of Poseidon
.
Intended for generic fixed-width hashing.
Implementations§
source§impl<'a, F> Instance<'a, F>where
F: PrimeField,
impl<'a, F> Instance<'a, F>where
F: PrimeField,
sourcepub fn new(parameters: &'a PoseidonParameters<F>) -> Instance<'a, F>
pub fn new(parameters: &'a PoseidonParameters<F>) -> Instance<'a, F>
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.
Auto Trait Implementations§
impl<'a, F> Freeze for Instance<'a, F>
impl<'a, F> RefUnwindSafe for Instance<'a, F>where
F: RefUnwindSafe,
impl<'a, F> Send for Instance<'a, F>
impl<'a, F> Sync for Instance<'a, F>
impl<'a, F> Unpin for Instance<'a, F>where
F: Unpin,
impl<'a, F> UnwindSafe for Instance<'a, F>where
F: UnwindSafe + RefUnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more