pub struct ArithmeticSponge<F: Field, SC: SpongeConstants, const FULL_ROUNDS: usize> {
pub sponge_state: SpongeState,
rate: usize,
pub state: Vec<F>,
params: &'static ArithmeticSpongeParams<F, FULL_ROUNDS>,
pub constants: PhantomData<SC>,
}Fields§
§sponge_state: SpongeState§rate: usize§state: Vec<F>§params: &'static ArithmeticSpongeParams<F, FULL_ROUNDS>§constants: PhantomData<SC>Implementations§
Source§impl<F: Field, SC: SpongeConstants, const FULL_ROUNDS: usize> ArithmeticSponge<F, SC, FULL_ROUNDS>
impl<F: Field, SC: SpongeConstants, const FULL_ROUNDS: usize> ArithmeticSponge<F, SC, FULL_ROUNDS>
pub fn full_round(&mut self, r: usize)
pub fn poseidon_block_cipher(&mut self)
Trait Implementations§
Source§impl<F: Clone + Field, SC: Clone + SpongeConstants, const FULL_ROUNDS: usize> Clone for ArithmeticSponge<F, SC, FULL_ROUNDS>
impl<F: Clone + Field, SC: Clone + SpongeConstants, const FULL_ROUNDS: usize> Clone for ArithmeticSponge<F, SC, FULL_ROUNDS>
Source§fn clone(&self) -> ArithmeticSponge<F, SC, FULL_ROUNDS>
fn clone(&self) -> ArithmeticSponge<F, SC, FULL_ROUNDS>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<F: Field, SC: SpongeConstants, const FULL_ROUNDS: usize> Sponge<F, F, FULL_ROUNDS> for ArithmeticSponge<F, SC, FULL_ROUNDS>
impl<F: Field, SC: SpongeConstants, const FULL_ROUNDS: usize> Sponge<F, F, FULL_ROUNDS> for ArithmeticSponge<F, SC, FULL_ROUNDS>
Source§fn absorb(&mut self, x: &[F])
fn absorb(&mut self, x: &[F])
Absorb an array of field elements x into the sponge.
§Security
WARNING: This function produces collisions when inputs differ only in trailing zeros until reaching an even length input. Therefore, use only with inputs of fixed-length.
Source§fn new(params: &'static ArithmeticSpongeParams<F, FULL_ROUNDS>) -> Self
fn new(params: &'static ArithmeticSpongeParams<F, FULL_ROUNDS>) -> Self
Create a new cryptographic sponge using arithmetic sponge
paramsAuto Trait Implementations§
impl<F, SC, const FULL_ROUNDS: usize> Freeze for ArithmeticSponge<F, SC, FULL_ROUNDS>where
Vec<F>: Freeze,
&'static ArithmeticSpongeParams<F, FULL_ROUNDS>: Freeze,
PhantomData<SC>: Freeze,
impl<F, SC, const FULL_ROUNDS: usize> RefUnwindSafe for ArithmeticSponge<F, SC, FULL_ROUNDS>where
Vec<F>: RefUnwindSafe,
&'static ArithmeticSpongeParams<F, FULL_ROUNDS>: RefUnwindSafe,
PhantomData<SC>: RefUnwindSafe,
impl<F, SC, const FULL_ROUNDS: usize> Send for ArithmeticSponge<F, SC, FULL_ROUNDS>
impl<F, SC, const FULL_ROUNDS: usize> Sync for ArithmeticSponge<F, SC, FULL_ROUNDS>
impl<F, SC, const FULL_ROUNDS: usize> Unpin for ArithmeticSponge<F, SC, FULL_ROUNDS>where
Vec<F>: Unpin,
&'static ArithmeticSpongeParams<F, FULL_ROUNDS>: Unpin,
PhantomData<SC>: Unpin,
impl<F, SC, const FULL_ROUNDS: usize> UnsafeUnpin for ArithmeticSponge<F, SC, FULL_ROUNDS>where
Vec<F>: UnsafeUnpin,
&'static ArithmeticSpongeParams<F, FULL_ROUNDS>: UnsafeUnpin,
PhantomData<SC>: UnsafeUnpin,
impl<F, SC, const FULL_ROUNDS: usize> UnwindSafe for ArithmeticSponge<F, SC, FULL_ROUNDS>where
Vec<F>: UnwindSafe,
&'static ArithmeticSpongeParams<F, FULL_ROUNDS>: UnwindSafe,
PhantomData<SC>: 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