Skip to content

Commit 5a7facb

Browse files
authored
Merge pull request #16614 from MinaProtocol/feature/bump-proof-systems-to-master
Upgrade proof systems to master
2 parents b8cdab0 + eee8336 commit 5a7facb

26 files changed

+294
-294
lines changed

src/lib/crypto/kimchi_bindings/stubs/Cargo.lock

+15-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib/crypto/kimchi_bindings/stubs/src/lagrange_basis.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use ark_ec::AffineRepr;
22
use ark_poly::{EvaluationDomain, Radix2EvaluationDomain as D};
33
use cache::LagrangeCache;
44
use mina_curves::pasta::{Pallas, Vesta};
5-
use poly_commitment::{commitment::CommitmentCurve, srs::SRS};
5+
use poly_commitment::{commitment::CommitmentCurve, ipa::SRS, SRS as _};
66
use std::env;
77

88
pub trait WithLagrangeBasis<G: AffineRepr> {

src/lib/crypto/kimchi_bindings/stubs/src/lib.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,8 @@ pub use {
6868
CamlLookupCommitments, CamlProofWithPublic, CamlProverCommitments, CamlProverProof,
6969
},
7070
mina_poseidon::sponge::caml::CamlScalarChallenge,
71-
poly_commitment::commitment::caml::{CamlOpeningProof, CamlPolyComm},
71+
poly_commitment::{
72+
ipa::caml::CamlOpeningProof,
73+
commitment::caml::CamlPolyComm,
74+
},
7275
};

src/lib/crypto/kimchi_bindings/stubs/src/oracles.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ use mina_poseidon::{
1414
};
1515
use paste::paste;
1616
use poly_commitment::commitment::{caml::CamlPolyComm, shift_scalar, PolyComm};
17-
use poly_commitment::evaluation_proof::OpeningProof;
18-
use poly_commitment::SRS;
17+
use poly_commitment::{ipa::OpeningProof, SRS};
1918

2019
#[derive(ocaml::IntoValue, ocaml::FromValue, ocaml_gen::Struct)]
2120
pub struct CamlOracles<F> {

src/lib/crypto/kimchi_bindings/stubs/src/pasta_fp_plonk_index.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use kimchi::circuits::{constraints::ConstraintSystem, gate::CircuitGate};
1010
use kimchi::{linearization::expr_linearization, prover_index::ProverIndex};
1111
use mina_curves::pasta::{Fp, Pallas, Vesta, VestaParameters};
1212
use mina_poseidon::{constants::PlonkSpongeConstantsKimchi, sponge::DefaultFqSponge};
13-
use poly_commitment::{evaluation_proof::OpeningProof, SRS as _};
13+
use poly_commitment::{ipa::OpeningProof, SRS as _};
1414
use serde::{Deserialize, Serialize};
1515
use std::{
1616
fs::{File, OpenOptions},
@@ -85,7 +85,7 @@ pub fn caml_pasta_fp_plonk_index_create(
8585
};
8686

8787
// endo
88-
let (endo_q, _endo_r) = poly_commitment::srs::endos::<Pallas>();
88+
let (endo_q, _endo_r) = poly_commitment::ipa::endos::<Pallas>();
8989

9090
srs.0.with_lagrange_basis(cs.domain.d1);
9191

@@ -100,7 +100,7 @@ pub fn caml_pasta_fp_plonk_index_create(
100100
#[ocaml_gen::func]
101101
#[ocaml::func]
102102
pub fn caml_pasta_fp_plonk_index_max_degree(index: CamlPastaFpPlonkIndexPtr) -> ocaml::Int {
103-
index.as_ref().0.srs.max_degree() as isize
103+
index.as_ref().0.srs.max_poly_size() as isize
104104
}
105105

106106
#[ocaml_gen::func]

src/lib/crypto/kimchi_bindings/stubs/src/pasta_fp_plonk_proof.rs

+17-15
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use mina_poseidon::{
2929
sponge::{DefaultFqSponge, DefaultFrSponge},
3030
};
3131
use poly_commitment::commitment::{CommitmentCurve, PolyComm};
32-
use poly_commitment::evaluation_proof::OpeningProof;
32+
use poly_commitment::ipa::OpeningProof;
3333
use std::array;
3434
use std::convert::TryInto;
3535

@@ -66,7 +66,7 @@ pub fn caml_pasta_fp_plonk_proof_create(
6666
.iter()
6767
.map(Into::<Fp>::into)
6868
.collect();
69-
let comm = PolyComm::<Vesta> { elems: vec![sg] };
69+
let comm = PolyComm::<Vesta> { chunks: vec![sg] };
7070
RecursionChallenge { chals, comm }
7171
})
7272
.collect()
@@ -134,7 +134,7 @@ pub fn caml_pasta_fp_plonk_proof_create_and_verify(
134134
.iter()
135135
.map(Into::<Fp>::into)
136136
.collect();
137-
let comm = PolyComm::<Vesta> { elems: vec![sg] };
137+
let comm = PolyComm::<Vesta> { chunks: vec![sg] };
138138
RecursionChallenge { chals, comm }
139139
})
140140
.collect()
@@ -204,7 +204,7 @@ pub fn caml_pasta_fp_plonk_proof_example_with_lookup(
204204
polynomial::COLUMNS,
205205
wires::Wire,
206206
};
207-
use poly_commitment::srs::endos;
207+
use poly_commitment::ipa::endos;
208208

209209
let num_gates = 1000;
210210
let num_tables: usize = 5;
@@ -319,13 +319,13 @@ pub fn caml_pasta_fp_plonk_proof_example_with_foreign_field_mul(
319319
use kimchi::circuits::{
320320
constraints::ConstraintSystem,
321321
gate::{CircuitGate, Connect},
322-
polynomials::foreign_field_mul,
322+
polynomials::{foreign_field_mul, foreign_field_common::BigUintForeignFieldHelpers},
323323
wires::Wire,
324324
};
325325
use num_bigint::BigUint;
326326
use num_bigint::RandBigInt;
327-
use o1_utils::{foreign_field::BigUintForeignFieldHelpers, FieldHelpers};
328-
use poly_commitment::srs::endos;
327+
use o1_utils::FieldHelpers;
328+
use poly_commitment::ipa::endos;
329329
use rand::{rngs::StdRng, SeedableRng};
330330

331331
let foreign_field_modulus = Fq::modulus_biguint();
@@ -476,12 +476,14 @@ pub fn caml_pasta_fp_plonk_proof_example_with_range_check(
476476
) {
477477
use ark_ff::Zero;
478478
use kimchi::circuits::{
479-
constraints::ConstraintSystem, gate::CircuitGate, polynomials::range_check, wires::Wire,
479+
constraints::ConstraintSystem, gate::CircuitGate,
480+
polynomials::{range_check, foreign_field_common::BigUintForeignFieldHelpers},
481+
wires::Wire,
480482
};
481483
use num_bigint::BigUint;
482484
use num_bigint::RandBigInt;
483-
use o1_utils::{foreign_field::BigUintForeignFieldHelpers, BigUintFieldHelpers};
484-
use poly_commitment::srs::endos;
485+
use o1_utils::{BigUintFieldHelpers};
486+
use poly_commitment::ipa::endos;
485487
use rand::{rngs::StdRng, SeedableRng};
486488

487489
let rng = &mut StdRng::from_seed([255u8; 32]);
@@ -548,7 +550,7 @@ pub fn caml_pasta_fp_plonk_proof_example_with_range_check0(
548550
polynomials::{generic::GenericGateSpec, range_check},
549551
wires::Wire,
550552
};
551-
use poly_commitment::srs::endos;
553+
use poly_commitment::ipa::endos;
552554

553555
let gates = {
554556
// Public input row with value 0
@@ -626,7 +628,7 @@ pub fn caml_pasta_fp_plonk_proof_example_with_ffadd(
626628
wires::Wire,
627629
};
628630
use num_bigint::BigUint;
629-
use poly_commitment::srs::endos;
631+
use poly_commitment::ipa::endos;
630632

631633
// Includes a row to store value 1
632634
let num_public_inputs = 1;
@@ -749,7 +751,7 @@ pub fn caml_pasta_fp_plonk_proof_example_with_xor(
749751
polynomials::{generic::GenericGateSpec, xor},
750752
wires::Wire,
751753
};
752-
use poly_commitment::srs::endos;
754+
use poly_commitment::ipa::endos;
753755

754756
let num_public_inputs = 2;
755757

@@ -842,7 +844,7 @@ pub fn caml_pasta_fp_plonk_proof_example_with_rot(
842844
},
843845
wires::Wire,
844846
};
845-
use poly_commitment::srs::endos;
847+
use poly_commitment::ipa::endos;
846848

847849
// Includes the actual input of the rotation and a row with the zero value
848850
let num_public_inputs = 2;
@@ -982,7 +984,7 @@ pub fn caml_pasta_fp_plonk_proof_dummy() -> CamlProofWithPublic<CamlGVesta, Caml
982984
fn comm() -> PolyComm<Vesta> {
983985
let g = Vesta::generator();
984986
PolyComm {
985-
elems: vec![g, g, g],
987+
chunks: vec![g, g, g],
986988
}
987989
}
988990

src/lib/crypto/kimchi_bindings/stubs/src/pasta_fp_plonk_verifier_index.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ use kimchi::circuits::polynomials::permutation::{permutation_vanishing_polynomia
1515
use kimchi::circuits::wires::{COLUMNS, PERMUTS};
1616
use kimchi::{linearization::expr_linearization, verifier_index::VerifierIndex};
1717
use mina_curves::pasta::{Fp, Pallas, Vesta};
18-
use poly_commitment::commitment::caml::CamlPolyComm;
19-
use poly_commitment::evaluation_proof::OpeningProof;
20-
use poly_commitment::{commitment::PolyComm, srs::SRS};
18+
use poly_commitment::{
19+
commitment::{caml::CamlPolyComm, PolyComm},
20+
ipa::{OpeningProof, SRS},
21+
SRS as _,
22+
};
2123
use std::convert::TryInto;
2224
use std::path::Path;
2325
use std::sync::Arc;
@@ -71,7 +73,7 @@ impl From<CamlPastaFpPlonkVerifierIndex> for VerifierIndex<Vesta, OpeningProof<V
7173
let evals = index.evals;
7274
let shifts = index.shifts;
7375

74-
let (endo_q, _endo_r) = poly_commitment::srs::endos::<Pallas>();
76+
let (endo_q, _endo_r) = poly_commitment::ipa::endos::<Pallas>();
7577
let domain = Domain::<Fp>::new(1 << index.domain.log_size_of_group).expect("wrong size");
7678

7779
let coefficients_comm: Vec<PolyComm<Vesta>> =
@@ -171,7 +173,7 @@ pub fn read_raw(
171173
path: String,
172174
) -> Result<VerifierIndex<Vesta, OpeningProof<Vesta>>, ocaml::Error> {
173175
let path = Path::new(&path);
174-
let (endo_q, _endo_r) = poly_commitment::srs::endos::<Pallas>();
176+
let (endo_q, _endo_r) = poly_commitment::ipa::endos::<Pallas>();
175177
VerifierIndex::<Vesta, OpeningProof<Vesta>>::from_file(
176178
srs.0,
177179
path,

src/lib/crypto/kimchi_bindings/stubs/src/pasta_fq_plonk_index.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use kimchi::circuits::{constraints::ConstraintSystem, gate::CircuitGate};
1010
use kimchi::{linearization::expr_linearization, prover_index::ProverIndex};
1111
use mina_curves::pasta::{Fq, Pallas, PallasParameters, Vesta};
1212
use mina_poseidon::{constants::PlonkSpongeConstantsKimchi, sponge::DefaultFqSponge};
13-
use poly_commitment::evaluation_proof::OpeningProof;
13+
use poly_commitment::{ipa::OpeningProof, SRS as _};
1414
use serde::{Deserialize, Serialize};
1515
use std::{
1616
fs::{File, OpenOptions},
@@ -84,7 +84,7 @@ pub fn caml_pasta_fq_plonk_index_create(
8484
};
8585

8686
// endo
87-
let (endo_q, _endo_r) = poly_commitment::srs::endos::<Vesta>();
87+
let (endo_q, _endo_r) = poly_commitment::ipa::endos::<Vesta>();
8888

8989
srs.0.with_lagrange_basis(cs.domain.d1);
9090

@@ -99,7 +99,7 @@ pub fn caml_pasta_fq_plonk_index_create(
9999
#[ocaml_gen::func]
100100
#[ocaml::func]
101101
pub fn caml_pasta_fq_plonk_index_max_degree(index: CamlPastaFqPlonkIndexPtr) -> ocaml::Int {
102-
index.as_ref().0.srs.max_degree() as isize
102+
index.as_ref().0.srs.max_poly_size() as isize
103103
}
104104

105105
#[ocaml_gen::func]

src/lib/crypto/kimchi_bindings/stubs/src/pasta_fq_plonk_proof.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use mina_poseidon::{
2727
sponge::{DefaultFqSponge, DefaultFrSponge},
2828
};
2929
use poly_commitment::commitment::{CommitmentCurve, PolyComm};
30-
use poly_commitment::evaluation_proof::OpeningProof;
30+
use poly_commitment::ipa::OpeningProof;
3131
use std::array;
3232
use std::convert::TryInto;
3333

@@ -60,7 +60,7 @@ pub fn caml_pasta_fq_plonk_proof_create(
6060
.iter()
6161
.map(Into::<Fq>::into)
6262
.collect();
63-
let comm = PolyComm::<Pallas> { elems: vec![sg] };
63+
let comm = PolyComm::<Pallas> { chunks: vec![sg] };
6464
RecursionChallenge { chals, comm }
6565
})
6666
.collect()
@@ -175,7 +175,7 @@ pub fn caml_pasta_fq_plonk_proof_dummy() -> CamlProofWithPublic<CamlGPallas, Cam
175175
fn comm() -> PolyComm<Pallas> {
176176
let g = Pallas::generator();
177177
PolyComm {
178-
elems: vec![g, g, g],
178+
chunks: vec![g, g, g],
179179
}
180180
}
181181

src/lib/crypto/kimchi_bindings/stubs/src/pasta_fq_plonk_verifier_index.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ use kimchi::circuits::polynomials::permutation::{permutation_vanishing_polynomia
1515
use kimchi::circuits::wires::{COLUMNS, PERMUTS};
1616
use kimchi::{linearization::expr_linearization, verifier_index::VerifierIndex};
1717
use mina_curves::pasta::{Fq, Pallas, Vesta};
18-
use poly_commitment::{commitment::caml::CamlPolyComm, evaluation_proof::OpeningProof};
19-
use poly_commitment::{commitment::PolyComm, srs::SRS};
18+
use poly_commitment::{
19+
commitment::{caml::CamlPolyComm, PolyComm},
20+
ipa::{OpeningProof, SRS},
21+
SRS as _,
22+
};
2023
use std::convert::TryInto;
2124
use std::path::Path;
2225
use std::sync::Arc;
@@ -70,7 +73,7 @@ impl From<CamlPastaFqPlonkVerifierIndex> for VerifierIndex<Pallas, OpeningProof<
7073
let evals = index.evals;
7174
let shifts = index.shifts;
7275

73-
let (endo_q, _endo_r) = poly_commitment::srs::endos::<Vesta>();
76+
let (endo_q, _endo_r) = poly_commitment::ipa::endos::<Vesta>();
7477
let domain = Domain::<Fq>::new(1 << index.domain.log_size_of_group).expect("wrong size");
7578

7679
let coefficients_comm: Vec<PolyComm<Pallas>> =
@@ -170,7 +173,7 @@ pub fn read_raw(
170173
path: String,
171174
) -> Result<VerifierIndex<Pallas, OpeningProof<Pallas>>, ocaml::Error> {
172175
let path = Path::new(&path);
173-
let (endo_q, _endo_r) = poly_commitment::srs::endos::<Vesta>();
176+
let (endo_q, _endo_r) = poly_commitment::ipa::endos::<Vesta>();
174177
VerifierIndex::<Pallas, OpeningProof<Pallas>>::from_file(
175178
srs.0,
176179
path,

src/lib/crypto/kimchi_bindings/stubs/src/projective.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@ macro_rules! impl_projective {
7979
#[ocaml_gen::func]
8080
#[ocaml::func]
8181
pub extern "C" fn [<caml_ $name:snake _endo_base>]() -> $CamlBaseField {
82-
let (endo_q, _endo_r) = poly_commitment::srs::endos::<GAffine>();
82+
let (endo_q, _endo_r) = poly_commitment::ipa::endos::<GAffine>();
8383
endo_q.into()
8484
}
8585

8686
#[ocaml_gen::func]
8787
#[ocaml::func]
8888
pub extern "C" fn [<caml_ $name:snake _endo_scalar>]() -> $CamlScalarField {
89-
let (_endo_q, endo_r) = poly_commitment::srs::endos::<GAffine>();
89+
let (_endo_q, endo_r) = poly_commitment::ipa::endos::<GAffine>();
9090
endo_r.into()
9191
}
9292

0 commit comments

Comments
 (0)