[−][src]Struct neptune::poseidon::Poseidon
The Poseidon
structure will accept a number of inputs equal to the arity.
Fields
elements: GenericArray<E::Fr, A::ConstantsSize>
the elements to permute
Implementations
impl<'a, E, A> Poseidon<'a, E, A> where
E: ScalarEngine,
A: Arity<E::Fr>,
[src]
E: ScalarEngine,
A: Arity<E::Fr>,
pub fn new(constants: &'a PoseidonConstants<E, A>) -> Self
[src]
pub fn new_with_preimage(
preimage: &[E::Fr],
constants: &'a PoseidonConstants<E, A>
) -> Self
[src]
preimage: &[E::Fr],
constants: &'a PoseidonConstants<E, A>
) -> Self
pub fn set_preimage(&mut self, preimage: &[E::Fr])
[src]
Replace the elements with the provided optional items.
Panics
Panics if the provided slice is bigger than the arity.
pub fn reset(&mut self)
[src]
Restore the initial state
pub fn input(&mut self, element: E::Fr) -> Result<usize, Error>
[src]
The returned usize
represents the element position (within arity) for the input operation
pub fn hash_in_mode(&mut self, mode: HashMode) -> E::Fr
[src]
pub fn hash(&mut self) -> E::Fr
[src]
pub fn hash_optimized_static(&mut self) -> E::Fr
[src]
Trait Implementations
impl<'a, E: Clone, A: Clone> Clone for Poseidon<'a, E, A> where
E: ScalarEngine,
A: Arity<E::Fr>,
E::Fr: Clone,
A::ConstantsSize: Clone,
[src]
E: ScalarEngine,
A: Arity<E::Fr>,
E::Fr: Clone,
A::ConstantsSize: Clone,
impl<'a, E: Debug, A: Debug> Debug for Poseidon<'a, E, A> where
E: ScalarEngine,
A: Arity<E::Fr>,
E::Fr: Debug,
A::ConstantsSize: Debug,
[src]
E: ScalarEngine,
A: Arity<E::Fr>,
E::Fr: Debug,
A::ConstantsSize: Debug,
impl<'a, E: PartialEq, A: PartialEq> PartialEq<Poseidon<'a, E, A>> for Poseidon<'a, E, A> where
E: ScalarEngine,
A: Arity<E::Fr>,
E::Fr: PartialEq,
A::ConstantsSize: PartialEq,
[src]
E: ScalarEngine,
A: Arity<E::Fr>,
E::Fr: PartialEq,
A::ConstantsSize: PartialEq,
pub fn eq(&self, other: &Poseidon<'a, E, A>) -> bool
[src]
pub fn ne(&self, other: &Poseidon<'a, E, A>) -> bool
[src]
impl<'a, E, A> StructuralPartialEq for Poseidon<'a, E, A> where
E: ScalarEngine,
A: Arity<E::Fr>,
[src]
E: ScalarEngine,
A: Arity<E::Fr>,
Auto Trait Implementations
impl<'a, E, A> RefUnwindSafe for Poseidon<'a, E, A> where
A: RefUnwindSafe,
E: RefUnwindSafe,
<<A as Arity<<E as ScalarEngine>::Fr>>::ConstantsSize as ArrayLength<<E as ScalarEngine>::Fr>>::ArrayType: RefUnwindSafe,
<E as ScalarEngine>::Fr: RefUnwindSafe,
[src]
A: RefUnwindSafe,
E: RefUnwindSafe,
<<A as Arity<<E as ScalarEngine>::Fr>>::ConstantsSize as ArrayLength<<E as ScalarEngine>::Fr>>::ArrayType: RefUnwindSafe,
<E as ScalarEngine>::Fr: RefUnwindSafe,
impl<'a, E, A> Send for Poseidon<'a, E, A> where
A: Sync,
E: Send,
[src]
A: Sync,
E: Send,
impl<'a, E, A> Sync for Poseidon<'a, E, A> where
A: Sync,
E: Sync,
[src]
A: Sync,
E: Sync,
impl<'a, E, A> Unpin for Poseidon<'a, E, A> where
E: Unpin,
<<A as Arity<<E as ScalarEngine>::Fr>>::ConstantsSize as ArrayLength<<E as ScalarEngine>::Fr>>::ArrayType: Unpin,
[src]
E: Unpin,
<<A as Arity<<E as ScalarEngine>::Fr>>::ConstantsSize as ArrayLength<<E as ScalarEngine>::Fr>>::ArrayType: Unpin,
impl<'a, E, A> UnwindSafe for Poseidon<'a, E, A> where
A: RefUnwindSafe,
E: UnwindSafe,
<<A as Arity<<E as ScalarEngine>::Fr>>::ConstantsSize as ArrayLength<<E as ScalarEngine>::Fr>>::ArrayType: UnwindSafe,
<E as ScalarEngine>::Fr: RefUnwindSafe,
[src]
A: RefUnwindSafe,
E: UnwindSafe,
<<A as Arity<<E as ScalarEngine>::Fr>>::ConstantsSize as ArrayLength<<E as ScalarEngine>::Fr>>::ArrayType: UnwindSafe,
<E as ScalarEngine>::Fr: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,