Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
iquerejeta committed Dec 20, 2024
1 parent 3474084 commit d3a6715
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
4 changes: 3 additions & 1 deletion src/plonk/keygen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,11 @@ impl<F: Field> Assignment<F> for Assembly<F> {
}
}

// This code also appears in `keygen`. We duplicate it here for simplicity of the
// function body.
fn k_from_circuit<F: Ord + Field + FromUniformBytes<64>, C: Circuit<F>>(circuit: &C) -> u32 {
// TODO: We could optimize the order here.
(3..25)
(1..25)
.find(|k| {
let n = 2usize.pow(*k);

Expand Down
14 changes: 7 additions & 7 deletions src/poly/commitment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,14 @@ pub trait PolynomialCommitmentScheme<F: PrimeField>: Clone + Debug {
/// Generates the parameters of the polynomial commitment scheme
fn gen_params(k: u32) -> Self::Parameters;

/// Generate the `VerifierParameters` from `Parameters`
fn v_params_from_params(params: &Self::Parameters) -> Self::VerifierParameters;
/// Extract the `VerifierParameters` from `Parameters`
fn get_verifier_params(params: &Self::Parameters) -> Self::VerifierParameters;

/// Commit to a polynomial in coefficient form
fn commit(params: &Self::Parameters, polynomial: &Polynomial<F, Coeff>) -> Self::Commitment;

/// Commit to a polynomial using its evaluations over the $2^k$ size
/// evaluation domain. The commitment will be blinded by the blinding factor
/// `r`.
/// Commit to a polynomial expressed in Lagrange evaluations form (over the underlying domain
/// specified in params).
fn commit_lagrange(
params: &Self::Parameters,
poly: &Polynomial<F, LagrangeCoeff>,
Expand Down Expand Up @@ -66,10 +65,11 @@ pub trait Guard<F: PrimeField, CS: PolynomialCommitmentScheme<F>>: Sized {
/// Finalize a batch of verification guards
fn batch_verify<'a, I, J>(guards: I, params: J) -> Result<(), Error>
where
I: IntoIterator<Item = Self>,
J: IntoIterator<Item = &'a CS::VerifierParameters>,
I: ExactSizeIterator<Item = Self>,
J: ExactSizeIterator<Item = &'a CS::VerifierParameters>,
CS::VerifierParameters: 'a,
{
assert_eq!(guards.len(), params.len());
guards
.into_iter()
.zip(params)
Expand Down
2 changes: 1 addition & 1 deletion src/poly/kzg/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ where
ParamsKZG::unsafe_setup(k, OsRng)
}

fn v_params_from_params(params: &Self::Parameters) -> Self::VerifierParameters {
fn get_verifier_params(params: &Self::Parameters) -> Self::VerifierParameters {
params.verifier_params()
}

Expand Down

0 comments on commit d3a6715

Please sign in to comment.