pub trait FrSponge<Fr: Field> {
    // Required methods
    fn new(p: &'static ArithmeticSpongeParams<Fr>) -> Self;
    fn absorb(&mut self, x: &Fr);
    fn absorb_multiple(&mut self, x: &[Fr]);
    fn challenge(&mut self) -> ScalarChallenge<Fr>;
    fn digest(self) -> Fr;
    fn absorb_evaluations(
        &mut self,
        e: &ProofEvaluations<PointEvaluations<Vec<Fr>>>
    );
}
Expand description

Abstracts a sponge that operates on the scalar field of an elliptic curve. Unlike the FqSponge it cannot absorb or digest base field elements. However, the FqSponge can also operate on the scalar field by the means of a specific encoding technique.

Required Methods§

source

fn new(p: &'static ArithmeticSpongeParams<Fr>) -> Self

Creates a new Fr-Sponge.

source

fn absorb(&mut self, x: &Fr)

Absorbs the field element into the sponge.

source

fn absorb_multiple(&mut self, x: &[Fr])

Absorbs a slice of field elements into the sponge.

source

fn challenge(&mut self) -> ScalarChallenge<Fr>

Creates a [ScalarChallenge] by squeezing the sponge.

source

fn digest(self) -> Fr

Consumes the sponge and returns the current digest, by squeezing.

source

fn absorb_evaluations( &mut self, e: &ProofEvaluations<PointEvaluations<Vec<Fr>>> )

Absorbs the given evaluations into the sponge.

Implementations on Foreign Types§

source§

impl<Fr: PrimeField> FrSponge<Fr> for DefaultFrSponge<Fr, SC>

source§

fn new(params: &'static ArithmeticSpongeParams<Fr>) -> DefaultFrSponge<Fr, SC>

source§

fn absorb(&mut self, x: &Fr)

source§

fn absorb_multiple(&mut self, x: &[Fr])

source§

fn challenge(&mut self) -> ScalarChallenge<Fr>

source§

fn digest(self) -> Fr

source§

fn absorb_evaluations( &mut self, e: &ProofEvaluations<PointEvaluations<Vec<Fr>>> )

Implementors§