Skip to content

Commit

Permalink
Update another part
Browse files Browse the repository at this point in the history
  • Loading branch information
WizardOfMenlo committed Jul 27, 2024
1 parent cb3b9ef commit 2badf8d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ ark-bls12-381 = {version="0.4.0", optional=true}


[features]
default = []
default = ["ark"]
ark = ["dep:ark-ff", "dep:ark-ec", "dep:ark-serialize"]
group = ["dep:group"]
ark-bls12-381 = ["ark", "dep:ark-bls12-381"]
Expand Down
24 changes: 18 additions & 6 deletions src/plugins/ark/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,22 @@ where

// Field <-> Field interactions:

impl<H, R, C, const N: usize> FieldPublic<Fp<C, N>> for Merlin<H, Fp<C, N>, R>
impl<F, H, R, C, const N: usize> FieldPublic<F> for Merlin<H, Fp<C, N>, R>
where
F: Field<BasePrimeField = Fp<C, N>>,
H: DuplexHash<Fp<C, N>>,
R: RngCore + CryptoRng,
C: FpConfig<N>,
{
type Repr = ();

fn public_scalars(&mut self, input: &[Fp<C, N>]) -> ProofResult<Self::Repr> {
self.public_units(input)?;
fn public_scalars(&mut self, input: &[F]) -> ProofResult<Self::Repr> {
let flattened: Vec<_> = input
.into_iter()
.map(|f| f.to_base_prime_field_elements())
.flatten()
.collect();
self.public_units(&flattened)?;
Ok(())
}
}
Expand All @@ -131,15 +137,21 @@ where
//
//

impl<H, C, const N: usize> FieldPublic<Fp<C, N>> for Arthur<'_, H, Fp<C, N>>
impl<F, H, C, const N: usize> FieldPublic<F> for Arthur<'_, H, Fp<C, N>>
where
F: Field<BasePrimeField = Fp<C, N>>,
H: DuplexHash<Fp<C, N>>,
C: FpConfig<N>,
{
type Repr = ();

fn public_scalars(&mut self, input: &[Fp<C, N>]) -> ProofResult<Self::Repr> {
self.public_units(input)?;
fn public_scalars(&mut self, input: &[F]) -> ProofResult<Self::Repr> {
let flattened: Vec<_> = input
.into_iter()
.map(|f| f.to_base_prime_field_elements())
.flatten()
.collect();
self.public_units(&flattened)?;
Ok(())
}
}
Expand Down

0 comments on commit 2badf8d

Please sign in to comment.