Struct arkworks_utils::poseidon::PoseidonParameters
source · [−]pub struct PoseidonParameters<F: PrimeField> {
pub round_keys: Vec<F>,
pub mds_matrix: Vec<Vec<F>>,
pub full_rounds: u8,
pub partial_rounds: u8,
pub width: u8,
pub sbox: PoseidonSbox,
}
Expand description
The Poseidon permutation.
Fields
round_keys: Vec<F>
The round key constants
mds_matrix: Vec<Vec<F>>
The MDS matrix to apply in the mix layer.
full_rounds: u8
Number of full SBox rounds
partial_rounds: u8
Number of partial rounds
width: u8
The size of the permutation, in field elements.
sbox: PoseidonSbox
The S-box to apply in the sub words layer.
Implementations
sourceimpl<F: PrimeField> PoseidonParameters<F>
impl<F: PrimeField> PoseidonParameters<F>
pub fn new(
round_keys: Vec<F>,
mds_matrix: Vec<Vec<F>>,
full_rounds: u8,
partial_rounds: u8,
width: u8,
sbox: PoseidonSbox
) -> Self
pub fn generate<R: Rng>(_rng: &mut R) -> Self
pub fn create_mds<R: Rng>(_rng: &mut R) -> Vec<Vec<F>>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
pub fn create_round_keys<R: Rng>(_rng: &mut R) -> Vec<F>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
pub fn to_bytes(&self) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
pub fn from_bytes(bytes: &[u8]) -> Result<Self, Error>
Trait Implementations
sourceimpl<F: Clone + PrimeField> Clone for PoseidonParameters<F>
impl<F: Clone + PrimeField> Clone for PoseidonParameters<F>
sourcefn clone(&self) -> PoseidonParameters<F>
fn clone(&self) -> PoseidonParameters<F>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<F: Debug + PrimeField> Debug for PoseidonParameters<F>
impl<F: Debug + PrimeField> Debug for PoseidonParameters<F>
sourceimpl<F: Default + PrimeField> Default for PoseidonParameters<F>
impl<F: Default + PrimeField> Default for PoseidonParameters<F>
sourcefn default() -> PoseidonParameters<F>
fn default() -> PoseidonParameters<F>
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl<F> RefUnwindSafe for PoseidonParameters<F> where
F: RefUnwindSafe,
impl<F> Send for PoseidonParameters<F>
impl<F> Sync for PoseidonParameters<F>
impl<F> Unpin for PoseidonParameters<F> where
F: Unpin,
impl<F> UnwindSafe for PoseidonParameters<F> where
F: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more