[][src]Struct neptune::poseidon::PoseidonConstants

pub struct PoseidonConstants<E, A> where
    E: ScalarEngine,
    A: Arity<E::Fr>, 
{ pub mds_matrices: MDSMatrices<E>, pub round_constants: Vec<E::Fr>, pub compressed_round_constants: Vec<E::Fr>, pub pre_sparse_matrix: Vec<Vec<E::Fr>>, pub sparse_matrixes: Vec<SparseMatrix<E>>, pub strength: Strength, pub domain_tag: E::Fr, pub full_rounds: usize, pub half_full_rounds: usize, pub partial_rounds: usize, pub hash_type: HashType<E::Fr, A>, // some fields omitted }

Fields

mds_matrices: MDSMatrices<E>round_constants: Vec<E::Fr>compressed_round_constants: Vec<E::Fr>pre_sparse_matrix: Vec<Vec<E::Fr>>sparse_matrixes: Vec<SparseMatrix<E>>strength: Strengthdomain_tag: E::Fr

The domain tag is the first element of a Poseidon permutation. This extra element is necessary for 128-bit security.

full_rounds: usizehalf_full_rounds: usizepartial_rounds: usizehash_type: HashType<E::Fr, A>

Implementations

impl<'a, E, A> PoseidonConstants<E, A> where
    E: ScalarEngine,
    A: Arity<E::Fr>, 
[src]

pub fn new() -> Self[src]

pub fn new_constant_length(length: usize) -> Self[src]

new_constant_length creates constants for hashing a constant-sized preimage which is <= the max supported by the permutation width.

pub fn with_length(&self, length: usize) -> Self[src]

pub fn new_with_strength(strength: Strength) -> Self[src]

pub fn new_with_strength_and_type(
    strength: Strength,
    hash_type: HashType<E::Fr, A>
) -> Self
[src]

pub fn arity(&self) -> usize[src]

Returns the width.

pub fn width(&self) -> usize[src]

Returns the width.

Trait Implementations

impl<E: Clone, A: Clone> Clone for PoseidonConstants<E, A> where
    E: ScalarEngine,
    A: Arity<E::Fr>,
    E::Fr: Clone,
    E::Fr: Clone,
    E::Fr: Clone,
    E::Fr: Clone,
    E::Fr: Clone
[src]

impl<E: Debug, A: Debug> Debug for PoseidonConstants<E, A> where
    E: ScalarEngine,
    A: Arity<E::Fr>,
    E::Fr: Debug,
    E::Fr: Debug,
    E::Fr: Debug,
    E::Fr: Debug,
    E::Fr: Debug
[src]

impl<E: PartialEq, A: PartialEq> PartialEq<PoseidonConstants<E, A>> for PoseidonConstants<E, A> where
    E: ScalarEngine,
    A: Arity<E::Fr>,
    E::Fr: PartialEq,
    E::Fr: PartialEq,
    E::Fr: PartialEq,
    E::Fr: PartialEq,
    E::Fr: PartialEq
[src]

impl<E, A> StructuralPartialEq for PoseidonConstants<E, A> where
    E: ScalarEngine,
    A: Arity<E::Fr>, 
[src]

Auto Trait Implementations

impl<E, A> RefUnwindSafe for PoseidonConstants<E, A> where
    A: RefUnwindSafe,
    <E as ScalarEngine>::Fr: RefUnwindSafe
[src]

impl<E, A> Send for PoseidonConstants<E, A> where
    A: Send
[src]

impl<E, A> Sync for PoseidonConstants<E, A> where
    A: Sync
[src]

impl<E, A> Unpin for PoseidonConstants<E, A> where
    A: Unpin,
    <E as ScalarEngine>::Fr: Unpin
[src]

impl<E, A> UnwindSafe for PoseidonConstants<E, A> where
    A: UnwindSafe,
    <E as ScalarEngine>::Fr: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,