kimchi_msm/
lib.rs

1use mina_poseidon::{
2    constants::PlonkSpongeConstantsKimchi,
3    sponge::{DefaultFqSponge, DefaultFrSponge},
4};
5use poly_commitment::kzg::KZGProof;
6
7pub use logup::{
8    Logup, LogupWitness, LookupProof as LogupProof, LookupTable as LogupTable,
9    LookupTableID as LogupTableID, LookupTableID,
10};
11
12pub mod circuit_design;
13pub mod column_env;
14pub mod columns;
15pub mod expr;
16pub mod logup;
17/// Instantiations of Logups for the MSM project
18// REMOVEME. The different interpreters must define their own tables.
19pub mod lookups;
20pub mod precomputed_srs;
21pub mod proof;
22pub mod prover;
23pub mod verifier;
24pub mod witness;
25
26pub mod fec;
27pub mod ffa;
28pub mod serialization;
29pub mod test;
30
31/// Define the maximum degree we support for the evaluations.
32/// For instance, it can be used to split the looked-up functions into partial
33/// sums.
34const MAX_SUPPORTED_DEGREE: usize = 8;
35
36/// Domain size for the MSM project, equal to the BN254 SRS size.
37pub const DOMAIN_SIZE: usize = 1 << 15;
38
39// @volhovm: maybe move these to the FF circuits module later.
40/// Bitsize of the foreign field limb representation.
41pub const LIMB_BITSIZE: usize = 15;
42
43/// Number of limbs representing one foreign field element (either
44/// [`Ff1`] or [`Ff2`]).
45pub const N_LIMBS: usize = 17;
46
47pub type BN254 = ark_ec::bn::Bn<ark_bn254::Config>;
48pub type BN254G1Affine = <BN254 as ark_ec::pairing::Pairing>::G1Affine;
49pub type BN254G2Affine = <BN254 as ark_ec::pairing::Pairing>::G2Affine;
50
51/// The native field we are working with.
52pub type Fp = ark_bn254::Fr;
53
54/// The foreign field we are emulating (one of the two)
55pub type Ff1 = mina_curves::pasta::Fp;
56pub type Ff2 = mina_curves::pasta::Fq;
57
58pub type SpongeParams = PlonkSpongeConstantsKimchi;
59pub type BaseSponge = DefaultFqSponge<ark_bn254::g1::Config, SpongeParams>;
60pub type ScalarSponge = DefaultFrSponge<Fp, SpongeParams>;
61pub type OpeningProof = KZGProof<BN254>;