-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2588 from o1-labs/volhovm/arkworks042-develop
Update arkworks to 0.4.2 (master)
- Loading branch information
Showing
126 changed files
with
2,665 additions
and
1,268 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
[package] | ||
name = "circuit-construction" | ||
version = "0.1.0" | ||
description = "A simple circuit writer for kimchi" | ||
repository = "https://github.com/o1-labs/proof-systems" | ||
edition = "2021" | ||
license = "Apache-2.0" | ||
homepage = "https://o1-labs.github.io/proof-systems/" | ||
documentation = "https://o1-labs.github.io/proof-systems/rustdoc/" | ||
readme = "../README.md" | ||
|
||
[lib] | ||
path = "src/lib.rs" | ||
bench = false # needed for criterion (https://bheisler.github.io/criterion.rs/book/faq.html#cargo-bench-gives-unrecognized-option-errors-for-valid-command-line-options) | ||
|
||
[dependencies] | ||
ark-ff.workspace = true | ||
ark-ec.workspace = true | ||
ark-poly.workspace = true | ||
ark-serialize.workspace = true | ||
blake2.workspace = true | ||
num-derive.workspace = true | ||
num-traits.workspace = true | ||
itertools.workspace = true | ||
rand.workspace = true | ||
rand_core.workspace = true | ||
rayon.workspace = true | ||
rmp-serde.workspace = true | ||
serde.workspace = true | ||
serde_with.workspace = true | ||
thiserror.workspace = true | ||
|
||
poly-commitment.workspace = true | ||
groupmap.workspace = true | ||
mina-curves.workspace = true | ||
o1-utils.workspace = true | ||
mina-poseidon.workspace = true | ||
kimchi.workspace = true | ||
|
||
[dev-dependencies] | ||
proptest.workspace = true | ||
proptest-derive.workspace = true | ||
colored.workspace = true | ||
|
||
# benchmarks | ||
criterion.workspace = true | ||
iai.workspace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
use ark_ec::AffineRepr; | ||
use ark_ff::Field; | ||
use kimchi::curve::KimchiCurve; | ||
use mina_curves::pasta::{Fp, Fq, Pallas as PallasAffine, Vesta as VestaAffine}; | ||
use mina_poseidon::poseidon::ArithmeticSpongeParams; | ||
use poly_commitment::{commitment::CommitmentCurve, srs::endos}; | ||
|
||
/// The type of possible constants in the circuit | ||
#[derive(Clone)] | ||
pub struct Constants<F: Field + 'static> { | ||
pub poseidon: &'static ArithmeticSpongeParams<F>, | ||
pub endo: F, | ||
pub base: (F, F), | ||
} | ||
|
||
/// Constants for the base field of Pallas | ||
/// /// | ||
/// # Panics | ||
/// | ||
/// Will panic if `PallasAffine::generator()` returns None. | ||
pub fn fp_constants() -> Constants<Fp> { | ||
let (endo_q, _endo_r) = endos::<PallasAffine>(); | ||
let base = PallasAffine::generator().to_coordinates().unwrap(); | ||
Constants { | ||
poseidon: VestaAffine::sponge_params(), | ||
endo: endo_q, | ||
base, | ||
} | ||
} | ||
|
||
/// Constants for the base field of Vesta | ||
/// | ||
/// # Panics | ||
/// | ||
/// Will panic if `VestaAffine::generator()` returns None. | ||
pub fn fq_constants() -> Constants<Fq> { | ||
let (endo_q, _endo_r) = endos::<VestaAffine>(); | ||
let base = VestaAffine::generator().to_coordinates().unwrap(); | ||
Constants { | ||
poseidon: PallasAffine::sponge_params(), | ||
endo: endo_q, | ||
base, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#![doc = include_str!("../../README.md")] | ||
|
||
/// Definition of possible constants in circuits | ||
pub mod constants; | ||
/// This contains the prover functions, ranging from curves definitions to prover index and proof generation | ||
pub mod prover; | ||
/// This is the actual writer with all of the available functions to set up a circuit and its corresponding constraint system | ||
pub mod writer; | ||
|
||
#[cfg(test)] | ||
mod tests; | ||
|
||
/// This contains the Kimchi dependencies being used | ||
pub mod prologue { | ||
pub use super::constants::{fp_constants, fq_constants, Constants}; | ||
pub use super::prover::{generate_prover_index, prove, CoordinateCurve}; | ||
pub use super::writer::{Cs, Var}; | ||
pub use ark_ec::{AffineRepr, CurveGroup}; | ||
pub use ark_ff::{FftField, PrimeField, UniformRand}; | ||
pub use ark_poly::{EvaluationDomain, Radix2EvaluationDomain}; | ||
pub use groupmap::GroupMap; | ||
pub use kimchi::verifier::verify; | ||
pub use mina_curves::pasta::{ | ||
Fp, Pallas as PallasAffine, Vesta as VestaAffine, VestaParameters, | ||
}; | ||
pub use mina_poseidon::{ | ||
constants::*, | ||
poseidon::{ArithmeticSponge, Sponge}, | ||
sponge::{DefaultFqSponge, DefaultFrSponge}, | ||
}; | ||
pub use poly_commitment::{commitment::CommitmentCurve, srs::SRS}; | ||
pub use std::sync::Arc; | ||
} |
Oops, something went wrong.