pub struct PRP<F> { /* private fields */ }
Expand description
Rescue pseudo-random permutation (PRP) instance
Implementations§
Source§impl<F: RescueParameter> PRP<F>
impl<F: RescueParameter> PRP<F>
Sourcepub fn prp(
&self,
key: &RescueVector<F>,
input: &RescueVector<F>,
) -> RescueVector<F>
pub fn prp( &self, key: &RescueVector<F>, input: &RescueVector<F>, ) -> RescueVector<F>
Rescue pseudorandom permutation for Bls12381 scalars vectors of size 4 without key scheduled keys (scheduling occurs online)
Sourcepub fn prp_with_round_keys(
&self,
round_keys: &[RescueVector<F>],
input: &RescueVector<F>,
) -> RescueVector<F>
pub fn prp_with_round_keys( &self, round_keys: &[RescueVector<F>], input: &RescueVector<F>, ) -> RescueVector<F>
Rescue pseudorandom permutation for Bls12381 scalars vectors of size 4 using scheduled keys
Sourcepub fn key_schedule(&self, key: &RescueVector<F>) -> Vec<RescueVector<F>>
pub fn key_schedule(&self, key: &RescueVector<F>) -> Vec<RescueVector<F>>
Key scheduling for rescue based PRP for Bls12_381 scalars vector of size 4
Sourcepub fn mds_matrix_ref(&self) -> &RescueMatrix<F>
pub fn mds_matrix_ref(&self) -> &RescueMatrix<F>
Return a pointer to the mds matrix. Does not expose secret states.
Sourcepub fn key_injection_vec_ref(&self) -> &[RescueVector<F>]
pub fn key_injection_vec_ref(&self) -> &[RescueVector<F>]
Return a pointer to the key injection vectors. Function needs to be public for circuits generation.. WARNING!!! May expose secret state if keys are supposed to be secret.
Sourcepub fn init_vec_ref(&self) -> &RescueVector<F>
pub fn init_vec_ref(&self) -> &RescueVector<F>
Return a pointer to the initial vectors. Does not expose secret states.
Trait Implementations§
Source§impl<F: RescueParameter> Default for PRP<F>
impl<F: RescueParameter> Default for PRP<F>
Source§impl<F: RescueParameter> From<PRP<F>> for Permutation<F>
impl<F: RescueParameter> From<PRP<F>> for Permutation<F>
Auto Trait Implementations§
impl<F> Freeze for PRP<F>where
F: Freeze,
impl<F> RefUnwindSafe for PRP<F>where
F: RefUnwindSafe,
impl<F> Send for PRP<F>where
F: Send,
impl<F> Sync for PRP<F>where
F: Sync,
impl<F> Unpin for PRP<F>where
F: Unpin,
impl<F> UnwindSafe for PRP<F>where
F: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more