Struct mina_poseidon::sponge::DefaultFqSponge
source · pub struct DefaultFqSponge<P: SWCurveConfig, SC: SpongeConstants> {
pub sponge: ArithmeticSponge<P::BaseField, SC>,
pub last_squeezed: Vec<u64>,
}
Fields§
§sponge: ArithmeticSponge<P::BaseField, SC>
§last_squeezed: Vec<u64>
Implementations§
source§impl<P: SWCurveConfig, SC: SpongeConstants> DefaultFqSponge<P, SC>where
P::BaseField: PrimeField,
<P::BaseField as PrimeField>::BigInt: Into<<P::ScalarField as PrimeField>::BigInt>,
impl<P: SWCurveConfig, SC: SpongeConstants> DefaultFqSponge<P, SC>where P::BaseField: PrimeField, <P::BaseField as PrimeField>::BigInt: Into<<P::ScalarField as PrimeField>::BigInt>,
pub fn squeeze_limbs(&mut self, num_limbs: usize) -> Vec<u64>
pub fn squeeze_field(&mut self) -> P::BaseField
pub fn squeeze(&mut self, num_limbs: usize) -> P::ScalarField
Trait Implementations§
source§impl<P: Clone + SWCurveConfig, SC: Clone + SpongeConstants> Clone for DefaultFqSponge<P, SC>where
P::BaseField: Clone,
impl<P: Clone + SWCurveConfig, SC: Clone + SpongeConstants> Clone for DefaultFqSponge<P, SC>where P::BaseField: Clone,
source§fn clone(&self) -> DefaultFqSponge<P, SC>
fn clone(&self) -> DefaultFqSponge<P, SC>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<P: SWCurveConfig, SC: SpongeConstants> FqSponge<<P as CurveConfig>::BaseField, Affine<P>, <P as CurveConfig>::ScalarField> for DefaultFqSponge<P, SC>where
P::BaseField: PrimeField,
<P::BaseField as PrimeField>::BigInt: Into<<P::ScalarField as PrimeField>::BigInt>,
impl<P: SWCurveConfig, SC: SpongeConstants> FqSponge<<P as CurveConfig>::BaseField, Affine<P>, <P as CurveConfig>::ScalarField> for DefaultFqSponge<P, SC>where P::BaseField: PrimeField, <P::BaseField as PrimeField>::BigInt: Into<<P::ScalarField as PrimeField>::BigInt>,
source§fn new(
params: &'static ArithmeticSpongeParams<P::BaseField>
) -> DefaultFqSponge<P, SC>
fn new( params: &'static ArithmeticSpongeParams<P::BaseField> ) -> DefaultFqSponge<P, SC>
Creates a new sponge.
source§fn absorb_g(&mut self, g: &[Affine<P>])
fn absorb_g(&mut self, g: &[Affine<P>])
Absorbs a base field point, that is a pair of
Fq
elements.source§fn absorb_fq(&mut self, x: &[P::BaseField])
fn absorb_fq(&mut self, x: &[P::BaseField])
Absorbs a base field element. This operation is the most
straightforward and calls the underlying sponge directly.
source§fn absorb_fr(&mut self, x: &[P::ScalarField])
fn absorb_fr(&mut self, x: &[P::ScalarField])
Absorbs an element of the scalar field
Fr
— it is done
by converting the element to the base field first.source§fn digest(self) -> P::ScalarField
fn digest(self) -> P::ScalarField
Returns a scalar field digest using the binary representation technique.
source§fn digest_fq(self) -> P::BaseField
fn digest_fq(self) -> P::BaseField
Returns a base field digest by squeezing the underlying sponge directly.
source§fn challenge(&mut self) -> P::ScalarField
fn challenge(&mut self) -> P::ScalarField
Squeeze out a challenge in the scalar field. Implemented by
squeezing out base points and then converting them to a scalar
field element using binary representation.
source§fn challenge_fq(&mut self) -> P::BaseField
fn challenge_fq(&mut self) -> P::BaseField
Squeeze out a base field challenge. This operation is the most
direct and calls the underlying sponge.
Auto Trait Implementations§
impl<P, SC> RefUnwindSafe for DefaultFqSponge<P, SC>where SC: RefUnwindSafe, <P as CurveConfig>::BaseField: RefUnwindSafe,
impl<P, SC> Send for DefaultFqSponge<P, SC>where SC: Send,
impl<P, SC> Sync for DefaultFqSponge<P, SC>where SC: Sync,
impl<P, SC> Unpin for DefaultFqSponge<P, SC>where SC: Unpin, <P as CurveConfig>::BaseField: Unpin,
impl<P, SC> UnwindSafe for DefaultFqSponge<P, SC>where SC: UnwindSafe, <P as CurveConfig>::BaseField: UnwindSafe + RefUnwindSafe,
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