Skip to content

Commit

Permalink
fmt and remove stray comment
Browse files Browse the repository at this point in the history
  • Loading branch information
lopeetall committed Dec 16, 2024
1 parent a963a1e commit 04b87a7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
22 changes: 14 additions & 8 deletions src/backends/kimchi/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use crate::{
};

use itertools::chain;
use kimchi::{mina_curves::pasta::{Vesta, VestaParameters}, poly_commitment::SRS as _};
use kimchi::mina_poseidon::constants::PlonkSpongeConstantsKimchi;
use kimchi::mina_poseidon::sponge::{DefaultFqSponge, DefaultFrSponge};
use kimchi::poly_commitment::commitment::CommitmentCurve;
Expand All @@ -21,6 +20,10 @@ use kimchi::{
circuits::constraints::ConstraintSystem, groupmap::GroupMap, mina_curves::pasta::Pallas,
poly_commitment::ipa::SRS,
};
use kimchi::{
mina_curves::pasta::{Vesta, VestaParameters},
poly_commitment::SRS as _,
};

use miette::{Context, IntoDiagnostic};
use once_cell::sync::Lazy;
Expand Down Expand Up @@ -107,7 +110,7 @@ impl KimchiVesta {
.wrap_err("kimchi: could not create a constraint system with the given circuit and public input size")?;

// create SRS (for vesta, as the circuit is in Fp)
let mut srs = SRS::<Curve>::create(cs.domain.d1.size as usize);
let srs = SRS::<Curve>::create(cs.domain.d1.size as usize);
srs.get_lagrange_basis(cs.domain.d1);
let srs = std::sync::Arc::new(srs);

Expand Down Expand Up @@ -198,12 +201,15 @@ impl ProverIndex {
}

// create proof
let proof =
ProverProof::create::<BaseSponge, ScalarSponge, _>(&GROUP_MAP, witness, &[], &self.index, &mut rand::rngs::OsRng)
//.map_err(|e| miette!(e))
.into_diagnostic()
.wrap_err("kimchi: could not create a proof with the given inputs")?;

let proof = ProverProof::create::<BaseSponge, ScalarSponge, _>(
&GROUP_MAP,
witness,
&[],
&self.index,
&mut rand::rngs::OsRng,
)
.into_diagnostic()
.wrap_err("kimchi: could not create a proof with the given inputs")?;

// return proof + public output
Ok((
Expand Down
2 changes: 1 addition & 1 deletion src/inputs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
use std::{collections::HashMap, fs::File, io::Read, str::FromStr};

use ark_ff::{One, Zero};
use kimchi::o1_utils::FieldHelpers;
use miette::Diagnostic;
use num_bigint::BigUint;
use thiserror::Error;
use kimchi::o1_utils::FieldHelpers;

use crate::{
backends::{kimchi::VestaField, Backend},
Expand Down
6 changes: 4 additions & 2 deletions src/serialization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ pub mod ser {
D: serde::Deserializer<'de>,
{
let bytes: Vec<u8> = Bytes::deserialize_as(deserializer)?;
T::deserialize_with_mode(&mut &bytes[..], Compress::Yes, Validate::Yes).map_err(serde::de::Error::custom)
T::deserialize_with_mode(&mut &bytes[..], Compress::Yes, Validate::Yes)
.map_err(serde::de::Error::custom)
}
}

Expand Down Expand Up @@ -77,6 +78,7 @@ where
D: serde::Deserializer<'de>,
{
let bytes: Vec<u8> = Bytes::deserialize_as(deserializer)?;
T::deserialize_with_mode(&mut &bytes[..], Compress::Yes, Validate::Yes).map_err(serde::de::Error::custom)
T::deserialize_with_mode(&mut &bytes[..], Compress::Yes, Validate::Yes)
.map_err(serde::de::Error::custom)
}
}

0 comments on commit 04b87a7

Please sign in to comment.