There are multiple sponge types, i.e. in "Kimchi":
pub trait FrSponge<Fr: Field> {
/// Creates a new Fr-Sponge.
fn new(p: ArithmeticSpongeParams<Fr>) -> Self;
/// Absorbs the field element into the sponge.
fn absorb(&mut self, x: &Fr);
/// Creates a [ScalarChallenge] by squeezing the sponge.
fn challenge(&mut self) -> ScalarChallenge<Fr>;
/// Absorbs the given evaluations into the sponge.
// TODO: IMO this function should be inlined in prover/verifier
fn absorb_evaluations(&mut self, p: &[Fr], e: &ProofEvaluations<Vec<Fr>>);
}
And in "Oracles":
impl<P: SWModelParameters, SC: SpongeConstants>
FqSponge<P::BaseField, GroupAffine<P>, P::ScalarField> for DefaultFqSponge<P, SC>
where
P::BaseField: PrimeField,
<P::BaseField as PrimeField>::BigInt: Into<<P::ScalarField as PrimeField>::BigInt>,
{
fn new(params: ArithmeticSpongeParams<P::BaseField>) -> DefaultFqSponge<P, SC> {
...
}
fn absorb_g(&mut self, g: &[GroupAffine<P>]) {
...
}
fn absorb_fr(&mut self, x: &[P::ScalarField]) {
...
}
fn digest(mut self) -> P::ScalarField {
...
}
fn challenge(&mut self) -> P::ScalarField {
self.squeeze(CHALLENGE_LENGTH_IN_LIMBS)
}
fn challenge_fq(&mut self) -> P::BaseField {
self.squeeze_field()
}
}
I believe these can be unified, particularly after adopting #636 (Introduce Absorb/Challenge traits) which enables implementing/deriving Absorb for ProofEvaluations (as done in the rust version of pickles)
There are multiple sponge types, i.e. in "Kimchi":
And in "Oracles":
I believe these can be unified, particularly after adopting #636 (Introduce Absorb/Challenge traits) which enables implementing/deriving
AbsorbforProofEvaluations(as done in the rust version of pickles)