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

Make this library build against more recent arkworks versions #9

Closed
wants to merge 6 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
28 changes: 9 additions & 19 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,16 @@ edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
ark-ff = { version = "^0.3.0", default-features = false }
ark-std = { version = "^0.3.0", default-features = false }
ark-r1cs-std = { version = "^0.3.0", default-features = false}
ark-sponge = { version = "^0.3.0", default-features = false }
ark-poly = { version = "0.3.0", default-features = false }
ark-relations = { version = "^0.3.0", default-features = false, optional = true}
ark-ff = { version = "^0.4.0", default-features = false }
ark-std = { version = "^0.4.0", default-features = false }
ark-r1cs-std = { version = "^0.4.0", default-features = false}
ark-crypto-primitives = { version = "^0.4.0", features = ["sponge"] }
ark-poly = { version = "^0.4.0", default-features = false }
ark-relations = { version = "^0.4.0", default-features = false, optional = true}
tracing = { version = "0.1", default-features = false, features = [ "attributes" ], optional = true}

[dev-dependencies]
ark-test-curves = { version = "^0.3.0", default-features = false, features = ["bls12_381_scalar_field", "mnt4_753_scalar_field"] }

[patch.crates-io]
ark-sponge = {git = "https://github.com/arkworks-rs/sponge"}
ark-r1cs-std = { git = "https://github.com/arkworks-rs/r1cs-std" }
ark-ec = { git = "https://github.com/arkworks-rs/algebra" }
ark-ff = { git = "https://github.com/arkworks-rs/algebra" }
ark-poly = { git = "https://github.com/arkworks-rs/algebra" }
ark-serialize = { git = "https://github.com/arkworks-rs/algebra" }
ark-std = { git = "https://github.com/arkworks-rs/std" }
ark-test-curves = { git = "https://github.com/arkworks-rs/algebra" }
ark-test-curves = { version = "^0.4.0", default-features = false, features = ["bls12_381_scalar_field", "mnt4_753_scalar_field"] }

[profile.release]
opt-level = 3
Expand Down Expand Up @@ -55,6 +45,6 @@ debug = true

[features]
default = ["std"]
std = ["ark-ff/std", "ark-std/std", "ark-relations/std", "ark-r1cs-std/std", "ark-sponge/std", "ark-poly/std"]
r1cs = ["ark-sponge/r1cs", "tracing", "ark-relations"]
std = ["ark-ff/std", "ark-std/std", "ark-relations/std", "ark-r1cs-std/std", "ark-crypto-primitives/std", "ark-poly/std"]
r1cs = ["ark-crypto-primitives/r1cs", "tracing", "ark-relations"]

6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,10 @@ This library comes with some unit and integration tests. Run these tests with:
cargo test
```

To use this library, you need to add the following to your `Cargo.toml`. Note that this configuration will bump `ark-sponge` and `ark-r1cs-std` to `master`/`main` instead of stable version on `crates.io`.
To use this library, you need to add the following to your `Cargo.toml`.
```toml
[dependencies]
ark-ldt = {git = "https://github.com/arkworks-rs/ldt", branch="main", default-features = false}

[patch.crates-io]
ark-sponge = {git = "https://github.com/arkworks-rs/sponge"}
ark-r1cs-std = {git = "https://github.com/arkworks-rs/r1cs-std", branch = "master"}
```

## License
Expand Down
9 changes: 5 additions & 4 deletions src/domain/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use ark_ff::PrimeField;
use ark_ff::fields::PrimeField;
use ark_poly::polynomial::univariate::DensePolynomial;
use ark_poly::{
DenseUVPolynomial, EvaluationDomain, Evaluations, Polynomial, Radix2EvaluationDomain,
Expand All @@ -11,13 +11,13 @@
use ark_r1cs_std::fields::FieldVar;
#[cfg(feature = "r1cs")]
use ark_relations::r1cs::SynthesisError;
use ark_std::vec::Vec;

Check failure on line 14 in src/domain/mod.rs

View workflow job for this annotation

GitHub Actions / Test (nightly)

the item `Vec` is imported redundantly

/// Given domain as `<g>`, `CosetOfDomain` represents `h<g>`
///
/// Constraint equivalent is in `r1cs_std::poly::domain`.
#[derive(Clone, Copy, Eq, PartialEq, Debug)]
pub struct Radix2CosetDomain<F: PrimeField> {
pub struct Radix2CosetDomain<F: PrimeField + ark_ff::fields::FftField> {
/// A non-coset radix 2 domain: `<g>`
pub base_domain: Radix2EvaluationDomain<F>,
/// offset `h`
Expand Down Expand Up @@ -174,8 +174,9 @@
#[cfg(test)]
mod tests {
use ark_poly::univariate::DensePolynomial;
use ark_poly::{DenseUVPolynomial, Polynomial};
use ark_std::{test_rng, UniformRand};
use ark_poly::DenseUVPolynomial;
use ark_poly::Polynomial;
use ark_std::{test_rng, vec, UniformRand};
use ark_test_curves::bls12_381::Fr;

use crate::domain::Radix2CosetDomain;
Expand Down
4 changes: 2 additions & 2 deletions src/fri/constraints/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
use crate::direct::constraints::DirectLDTGadget;
use crate::domain::Radix2CosetDomain;
use crate::fri::FRIParameters;
use ark_crypto_primitives::sponge::constraints::CryptographicSpongeVar;
use ark_crypto_primitives::sponge::FieldBasedCryptographicSponge;
use ark_ff::PrimeField;
use ark_r1cs_std::bits::boolean::Boolean;
use ark_r1cs_std::eq::EqGadget;
Expand All @@ -12,8 +14,6 @@ use ark_r1cs_std::poly::evaluations::univariate::EvaluationsVar;
use ark_r1cs_std::poly::polynomial::univariate::dense::DensePolynomialVar;
use ark_r1cs_std::prelude::CondSelectGadget;
use ark_relations::r1cs::SynthesisError;
use ark_sponge::constraints::CryptographicSpongeVar;
use ark_sponge::FieldBasedCryptographicSponge;
use ark_std::marker::PhantomData;
use ark_std::vec::Vec;

Expand Down
4 changes: 3 additions & 1 deletion src/fri/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
use crate::direct::DirectLDT;
use crate::domain::Radix2CosetDomain;
use crate::fri::FRIParameters;
use ark_crypto_primitives::sponge::FieldBasedCryptographicSponge;
use ark_ff::PrimeField;
use ark_poly::polynomial::univariate::DensePolynomial;
use ark_poly::Polynomial;
use ark_sponge::FieldBasedCryptographicSponge;
use ark_std::vec::Vec;

Check failure on line 10 in src/fri/verifier.rs

View workflow job for this annotation

GitHub Actions / Test (nightly)

the item `Vec` is imported redundantly

/// Implements FRI verifier.
pub struct FRIVerifier<F: PrimeField> {
Expand Down Expand Up @@ -238,6 +238,8 @@
use ark_poly::univariate::DensePolynomial;
use ark_poly::{DenseUVPolynomial, Polynomial};
use ark_std::test_rng;
use ark_std::vec;
use ark_std::vec::Vec;

Check failure on line 242 in src/fri/verifier.rs

View workflow job for this annotation

GitHub Actions / Test (nightly)

the item `Vec` is imported redundantly
use ark_test_curves::bls12_381::Fr;

use crate::direct::DirectLDT;
Expand Down
Loading