Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pipeline #63

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@ ark-ff = { git = "https://github.com/arkworks-rs/algebra/" }
ark-ec = { git = "https://github.com/arkworks-rs/algebra/" }
ark-serialize = { git = "https://github.com/arkworks-rs/algebra/" }
ark-poly = { git = "https://github.com/arkworks-rs/algebra/" }

ark-crypto-primitives = { git = "https://github.com/HungryCatsStudio/crypto-primitives", branch = "absorb"}
ark-crypto-primitives = { git = "https://github.com/HungryCatsStudio/crypto-primitives" }
ark-r1cs-std = { git = "https://github.com/arkworks-rs/r1cs-std/" }

ark-bls12-377 = { git = "https://github.com/arkworks-rs/curves/" }
ark-bls12-381 = { git = "https://github.com/arkworks-rs/curves/" }
ark-bn254 = { git = "https://github.com/arkworks-rs/curves/" }
4 changes: 2 additions & 2 deletions poly-commit/src/constraints.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
use crate::{
data_structures::LabeledCommitment, BatchLCProof, LCTerm, LinearCombination,
PCPreparedCommitment, PCPreparedVerifierKey, PolynomialCommitment, String, Vec,
PCPreparedCommitment, PCPreparedVerifierKey, PolynomialCommitment,
};
use ark_crypto_primitives::sponge::CryptographicSponge;
use ark_ff::PrimeField;
use ark_poly::Polynomial;
use ark_r1cs_std::fields::emulated_fp::EmulatedFpVar;
use ark_r1cs_std::{fields::fp::FpVar, prelude::*};
use ark_relations::r1cs::{ConstraintSystemRef, Namespace, Result as R1CSResult, SynthesisError};
use ark_std::{borrow::Borrow, cmp::Eq, cmp::PartialEq, hash::Hash, marker::Sized};
use ark_std::{borrow::Borrow, cmp::Eq, cmp::PartialEq, hash::Hash};
use hashbrown::{HashMap, HashSet};

/// Define the minimal interface of prepared allocated structures.
Expand Down
2 changes: 1 addition & 1 deletion poly-commit/src/data_structures.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{Polynomial, String, Vec};
use crate::Polynomial;
use ark_crypto_primitives::sponge::Absorb;
use ark_ff::{Field, PrimeField, ToConstraintField};
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
Expand Down
2 changes: 0 additions & 2 deletions poly-commit/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use crate::String;

/// The error type for `PolynomialCommitment`.
#[derive(Debug)]
pub enum Error {
Expand Down
4 changes: 1 addition & 3 deletions poly-commit/src/ipa_pc/data_structures.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use crate::*;
use crate::{PCCommitterKey, PCVerifierKey, Vec};
use ark_crypto_primitives::sponge::Absorb;
use ark_ec::AffineRepr;
use ark_ff::{Field, UniformRand, Zero};
use ark_ff::{UniformRand, Zero};
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
use ark_std::rand::RngCore;
use ark_std::vec;

/// `UniversalParams` are the universal parameters for the inner product arg scheme.
Expand Down
2 changes: 1 addition & 1 deletion poly-commit/src/ipa_pc/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{BTreeMap, BTreeSet, String, ToString, Vec, CHALLENGE_SIZE};
use crate::{BTreeMap, BTreeSet, CHALLENGE_SIZE};
use crate::{BatchLCProof, DenseUVPolynomial, Error, Evaluations, QuerySet};
use crate::{LabeledCommitment, LabeledPolynomial, LinearCombination};
use crate::{PCCommitmentState, PCCommitterKey, PCUniversalParams, PolynomialCommitment};
Expand Down
2 changes: 1 addition & 1 deletion poly-commit/src/kzg10/data_structures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use ark_crypto_primitives::sponge::Absorb;
use ark_ec::pairing::Pairing;
use ark_ec::AdditiveGroup;
use ark_ec::AffineRepr;
use ark_ff::{PrimeField, ToConstraintField};
use ark_ff::ToConstraintField;
use ark_serialize::{
CanonicalDeserialize, CanonicalSerialize, Compress, SerializationError, Valid, Validate,
};
Expand Down
3 changes: 1 addition & 2 deletions poly-commit/src/kzg10/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//! proposed by Kate, Zaverucha, and Goldberg ([KZG10](http://cacr.uwaterloo.ca/techreports/2010/cacr2010-10.pdf)).
//! This construction achieves extractability in the algebraic group model (AGM).

use crate::{BTreeMap, Error, LabeledPolynomial, PCCommitmentState, ToString, Vec};
use crate::{BTreeMap, Error, LabeledPolynomial, PCCommitmentState};
use ark_crypto_primitives::sponge::Absorb;
use ark_ec::AffineRepr;
use ark_ec::{pairing::Pairing, CurveGroup};
Expand Down Expand Up @@ -481,7 +481,6 @@ mod tests {
use ark_bls12_377::Bls12_377;
use ark_bls12_381::Bls12_381;
use ark_bls12_381::Fr;
use ark_ec::pairing::Pairing;
use ark_poly::univariate::DensePolynomial as DensePoly;
use ark_std::test_rng;

Expand Down
4 changes: 1 addition & 3 deletions poly-commit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ use ark_std::{
fmt::Debug,
hash::Hash,
iter::FromIterator,
string::{String, ToString},
vec::Vec,
};

Expand Down Expand Up @@ -273,7 +272,7 @@ pub trait PolynomialCommitment<F: PrimeField, P: Polynomial<F>, S: Cryptographic
// order to gather (i.e. batch) all polynomials that should be queried at
// the same point, then opening their commitments simultaneously with a
// single call to `open` (per point)
let rng = &mut crate::optional_rng::OptionalRng(rng);
let rng = &mut optional_rng::OptionalRng(rng);
let poly_st_comm: BTreeMap<_, _> = labeled_polynomials
.into_iter()
.zip(states)
Expand Down Expand Up @@ -632,7 +631,6 @@ fn lc_query_set_to_poly_query_set<'a, F: Field, T: Clone + Ord>(
pub mod tests {
use crate::*;
use ark_crypto_primitives::sponge::poseidon::{PoseidonConfig, PoseidonSponge};
use ark_poly::Polynomial;
use ark_std::rand::{
distributions::{Distribution, Uniform},
Rng, SeedableRng,
Expand Down
4 changes: 2 additions & 2 deletions poly-commit/src/linear_codes/data_structures.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use crate::{utils::Matrix, PCCommitment, PCCommitmentState};
use ark_crypto_primitives::{
crh::CRHScheme,
merkle_tree::{Config, LeafParam, Path, TwoToOneParam}, sponge::Absorb,
merkle_tree::{Config, LeafParam, Path, TwoToOneParam},
sponge::Absorb,
};
use ark_ff::PrimeField;
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
use ark_std::marker::PhantomData;
use ark_std::rand::RngCore;
use ark_std::vec::Vec;

#[derive(Derivative, CanonicalSerialize, CanonicalDeserialize)]
#[derivative(Clone(bound = ""), Debug(bound = ""))]
Expand Down
5 changes: 2 additions & 3 deletions poly-commit/src/linear_codes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ use ark_poly::Polynomial;
use ark_std::borrow::Borrow;
use ark_std::marker::PhantomData;
use ark_std::rand::RngCore;
use ark_std::string::ToString;
use ark_std::vec::Vec;

#[cfg(feature = "parallel")]
use rayon::iter::{IntoParallelIterator, IntoParallelRefIterator, ParallelIterator};
Expand Down Expand Up @@ -85,7 +83,8 @@ where
type LinCodePCParams: PCUniversalParams
+ PCCommitterKey
+ PCVerifierKey
+ LinCodeParametersInfo<C, H>;
+ LinCodeParametersInfo<C, H>
+ Sync;

/// Does a default setup for the PCS.
fn setup<R: RngCore>(
Expand Down
1 change: 0 additions & 1 deletion poly-commit/src/linear_codes/multilinear_ligero/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use ark_ff::{FftField, PrimeField};
use ark_poly::{MultilinearExtension, Polynomial};
use ark_std::log2;
use ark_std::marker::PhantomData;
use ark_std::vec::Vec;

mod tests;

Expand Down
2 changes: 0 additions & 2 deletions poly-commit/src/linear_codes/univariate_ligero/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ use ark_crypto_primitives::{merkle_tree::Config, sponge::CryptographicSponge};
use ark_ff::PrimeField;
use ark_poly::DenseUVPolynomial;
use ark_std::marker::PhantomData;
use ark_std::vec::Vec;

mod tests;

/// The univariate Ligero polynomial commitment scheme based on [[Ligero]][ligero].
Expand Down
7 changes: 1 addition & 6 deletions poly-commit/src/linear_codes/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ use crate::{utils::ceil_div, Error};
use ark_crypto_primitives::sponge::CryptographicSponge;
use ark_ff::{FftField, PrimeField};
use ark_poly::{EvaluationDomain, GeneralEvaluationDomain};
use ark_std::string::ToString;
use ark_std::vec::Vec;

#[cfg(not(feature = "std"))]
use num_traits::Float;
Expand Down Expand Up @@ -113,10 +111,7 @@ pub(crate) mod tests {

use ark_bls12_377::Fq;
use ark_bls12_377::Fr;
use ark_poly::{
domain::general::GeneralEvaluationDomain, univariate::DensePolynomial, DenseUVPolynomial,
Polynomial,
};
use ark_poly::{univariate::DensePolynomial, DenseUVPolynomial, Polynomial};
use ark_std::test_rng;
use rand_chacha::{rand_core::SeedableRng, ChaCha20Rng};

Expand Down
2 changes: 1 addition & 1 deletion poly-commit/src/marlin/marlin_pc/data_structures.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{
DenseUVPolynomial, PCCommitment, PCCommitmentState, PCCommitterKey, PCPreparedCommitment,
PCPreparedVerifierKey, PCVerifierKey, Vec,
PCPreparedVerifierKey, PCVerifierKey,
};
use ark_crypto_primitives::sponge::Absorb;
use ark_ec::pairing::Pairing;
Expand Down
2 changes: 1 addition & 1 deletion poly-commit/src/marlin/marlin_pc/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::{kzg10, marlin::Marlin, PCCommitterKey, CHALLENGE_SIZE};
use crate::{BTreeMap, BTreeSet, ToString, Vec};
use crate::{BTreeMap, BTreeSet};
use crate::{BatchLCProof, Error, Evaluations, QuerySet};
use crate::{LabeledCommitment, LabeledPolynomial, LinearCombination};
use crate::{PCCommitmentState, PCUniversalParams, PolynomialCommitment};
Expand Down
1 change: 0 additions & 1 deletion poly-commit/src/marlin/marlin_pst13_pc/combinations.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//! Compute all combinations of values in a given list
//! Credit: https://github.com/meltinglava/uniquecombinations/
use crate::Vec;

/// Compute all combinations of values in a given list.
pub(crate) struct Combinations<T>
Expand Down
2 changes: 1 addition & 1 deletion poly-commit/src/marlin/marlin_pst13_pc/data_structures.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{BTreeMap, Vec};
use crate::BTreeMap;
use crate::{
PCCommitmentState, PCCommitterKey, PCPreparedVerifierKey, PCUniversalParams, PCVerifierKey,
};
Expand Down
2 changes: 0 additions & 2 deletions poly-commit/src/marlin/marlin_pst13_pc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use crate::{
use crate::{BatchLCProof, Error, Evaluations, QuerySet};
use crate::{LabeledCommitment, LabeledPolynomial, LinearCombination};
use crate::{PCCommitmentState, PCUniversalParams, PolynomialCommitment};
use crate::{ToString, Vec};
use ark_ec::AffineRepr;
use ark_ec::{
pairing::Pairing,
Expand Down Expand Up @@ -712,7 +711,6 @@ mod tests {
multivariate::{SparsePolynomial as SparsePoly, SparseTerm},
DenseMVPolynomial,
};
use ark_std::vec::Vec;
use rand_chacha::ChaCha20Rng;

type MVPoly_381 = SparsePoly<<Bls12_381 as Pairing>::ScalarField, SparseTerm>;
Expand Down
2 changes: 1 addition & 1 deletion poly-commit/src/marlin/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::CHALLENGE_SIZE;
use crate::{kzg10, Error};
use crate::{BTreeMap, BTreeSet, Debug, RngCore, String, ToString, Vec};
use crate::{BTreeMap, BTreeSet, Debug, RngCore};
use crate::{BatchLCProof, LabeledPolynomial, LinearCombination};
use crate::{Evaluations, LabeledCommitment, QuerySet};
use crate::{PCCommitmentState, Polynomial, PolynomialCommitment};
Expand Down
1 change: 0 additions & 1 deletion poly-commit/src/multilinear_pc/data_structures.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use ark_ec::pairing::Pairing;
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
use ark_std::vec::Vec;
#[allow(type_alias_bounds)]
/// Evaluations over {0,1}^n for G1
pub type EvaluationHyperCubeOnG1<E: Pairing> = Vec<E::G1Affine>;
Expand Down
2 changes: 0 additions & 2 deletions poly-commit/src/multilinear_pc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use ark_std::iter::FromIterator;
use ark_std::marker::PhantomData;
use ark_std::ops::Mul;
use ark_std::rand::RngCore;
use ark_std::vec::Vec;
use ark_std::UniformRand;

/// data structures used by multilinear extension commitment scheme
Expand Down Expand Up @@ -246,7 +245,6 @@ mod tests {
};
use ark_std::rand::RngCore;
use ark_std::test_rng;
use ark_std::vec::Vec;
type E = Bls12_381;
type Fr = <E as Pairing>::ScalarField;

Expand Down
4 changes: 1 addition & 3 deletions poly-commit/src/sonic_pc/data_structures.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use crate::kzg10;
use crate::{
BTreeMap, PCCommitterKey, PCPreparedCommitment, PCPreparedVerifierKey, PCVerifierKey, Vec,
};
use crate::{BTreeMap, PCCommitterKey, PCPreparedCommitment, PCPreparedVerifierKey, PCVerifierKey};
use ark_crypto_primitives::sponge::Absorb;
use ark_ec::pairing::Pairing;
use ark_ec::AdditiveGroup;
Expand Down
2 changes: 1 addition & 1 deletion poly-commit/src/sonic_pc/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::{kzg10, PCCommitterKey, CHALLENGE_SIZE};
use crate::{BTreeMap, BTreeSet, String, ToString, Vec};
use crate::{BTreeMap, BTreeSet};
use crate::{BatchLCProof, DenseUVPolynomial, Error, Evaluations, QuerySet};
use crate::{LabeledCommitment, LabeledPolynomial, LinearCombination};
use crate::{PCCommitmentState, PCUniversalParams, PolynomialCommitment};
Expand Down
1 change: 0 additions & 1 deletion poly-commit/src/streaming_kzg/data_structures.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use ark_ff::Field;
use ark_std::borrow::Borrow;
use ark_std::vec::Vec;

use ark_std::iterable::Iterable;

Expand Down
1 change: 0 additions & 1 deletion poly-commit/src/streaming_kzg/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ mod time;

use ark_ec::CurveGroup;
use ark_serialize::{CanonicalSerialize, Compress};
use ark_std::vec::Vec;
pub use data_structures::*;
pub use space::CommitterKeyStream;
pub use time::CommitterKey;
Expand Down
1 change: 0 additions & 1 deletion poly-commit/src/streaming_kzg/space.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use ark_ff::{PrimeField, Zero};
use ark_poly::Polynomial;
use ark_std::borrow::Borrow;
use ark_std::collections::VecDeque;
use ark_std::vec::Vec;

use crate::streaming_kzg::{vanishing_polynomial, FoldedPolynomialTree};
use crate::utils::ceil_div;
Expand Down
1 change: 0 additions & 1 deletion poly-commit/src/streaming_kzg/tests.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use ark_bls12_381::{Bls12_381, Fr};
use ark_poly::univariate::DensePolynomial;
use ark_poly::DenseUVPolynomial;
use ark_std::vec::Vec;
use ark_std::{UniformRand, Zero};

use crate::streaming_kzg::space::CommitterKeyStream;
Expand Down
2 changes: 1 addition & 1 deletion poly-commit/src/streaming_kzg/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use ark_ec::scalar_mul::ScalarMul;
use ark_ec::CurveGroup;
use ark_ff::Zero;
use ark_poly::{univariate::DensePolynomial, DenseUVPolynomial};
use ark_std::{borrow::Borrow, ops::Div, ops::Mul, rand::RngCore, vec::Vec, UniformRand};
use ark_std::{borrow::Borrow, ops::Div, ops::Mul, rand::RngCore, UniformRand};

use crate::streaming_kzg::{
linear_combination, msm, powers, Commitment, EvaluationProof, VerifierKey,
Expand Down
1 change: 0 additions & 1 deletion poly-commit/src/utils.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use ark_ff::Field;
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
use ark_std::vec::Vec;

#[cfg(feature = "parallel")]
use rayon::{
Expand Down
Loading