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 3 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
7 changes: 4 additions & 3 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 @@ -17,7 +17,7 @@ use ark_std::vec::Vec;
///
/// 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,7 +174,8 @@ impl<F: PrimeField> Radix2CosetDomain<F> {
#[cfg(test)]
mod tests {
use ark_poly::univariate::DensePolynomial;
use ark_poly::{DenseUVPolynomial, Polynomial};
use ark_poly::DenseUVPolynomial;
use ark_poly::Polynomial;
use ark_std::{test_rng, UniformRand};
use ark_test_curves::bls12_381::Fr;

Expand Down
2 changes: 1 addition & 1 deletion src/fri/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ use ark_std::marker::PhantomData;
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;

/// Implements FRI verifier.
Expand Down