Skip to content

Commit 263cdb7

Browse files
alireza-shirzadz-techPratyush
authored
R1CS to GR1CS (#949)
* work * Trigger GitHub Actions rerun * Update --------- Co-authored-by: Andrew Zitek-Estrada <1497456+z-tech@users.noreply.github.com> Co-authored-by: Pratyush Mishra <pratyushmishra@berkeley.edu>
1 parent 78f655f commit 263cdb7

File tree

19 files changed

+83
-82
lines changed
  • curves
    • bls12_377/src/constraints
    • bn254/src/constraints
    • curve-constraint-tests/src
    • ed_on_bls12_377/src/constraints
    • ed_on_bls12_381_bandersnatch/src/constraints
    • ed_on_bls12_381/src/constraints
    • ed_on_bn254/src/constraints
    • ed_on_bw6_761/src/constraints
    • ed_on_cp6_782/src/constraints
    • ed_on_mnt4_298/src/constraints
    • ed_on_mnt4_753/src/constraints
    • grumpkin/src/constraints
    • mnt4_298/src/constraints
    • mnt4_753/src/constraints
    • mnt6_298/src/constraints
    • mnt6_753/src/constraints
    • pallas/src/constraints
    • vesta/src/constraints

19 files changed

+83
-82
lines changed

curves/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,5 +114,6 @@ ark-serialize = { path = "../serialize" }
114114
ark-algebra-test-templates = { path = "../test-templates" }
115115
ark-algebra-bench-templates = { path = "../bench-templates" }
116116
ark-curve-constraint-tests = { path = "./curve-constraint-tests" }
117-
ark-r1cs-std = { git = "https://github.com/arkworks-rs/r1cs-std/" }
118117
ark-std = { git = "https://github.com/arkworks-rs/std/" }
118+
ark-r1cs-std = { git = "https://github.com/arkworks-rs/r1cs-std" }
119+
ark-relations = { git = "https://github.com/arkworks-rs/snark" }

curves/bls12_377/src/constraints/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
//! One can perform standard algebraic operations on `FqVar`:
1212
//!
1313
//! ```
14-
//! # fn main() -> Result<(), ark_relations::r1cs::SynthesisError> {
14+
//! # fn main() -> Result<(), ark_relations::gr1cs::SynthesisError> {
1515
//! use ark_std::UniformRand;
16-
//! use ark_relations::r1cs::*;
16+
//! use ark_relations::gr1cs::*;
1717
//! use ark_r1cs_std::prelude::*;
1818
//! use ark_bls12_377::{*, constraints::*};
1919
//!
@@ -60,9 +60,9 @@
6060
//! One can also perform standard algebraic operations on `G1Var` and `G2Var`:
6161
//!
6262
//! ```
63-
//! # fn main() -> Result<(), ark_relations::r1cs::SynthesisError> {
63+
//! # fn main() -> Result<(), ark_relations::gr1cs::SynthesisError> {
6464
//! # use ark_std::UniformRand;
65-
//! # use ark_relations::r1cs::*;
65+
//! # use ark_relations::gr1cs::*;
6666
//! # use ark_r1cs_std::prelude::*;
6767
//! # use ark_bls12_377::{*, constraints::*};
6868
//!
@@ -104,10 +104,10 @@
104104
//! Finally, one can check pairing computations as well:
105105
//!
106106
//! ```
107-
//! # fn main() -> Result<(), ark_relations::r1cs::SynthesisError> {
107+
//! # fn main() -> Result<(), ark_relations::gr1cs::SynthesisError> {
108108
//! # use ark_std::UniformRand;
109109
//! # use ark_ec::pairing::Pairing;
110-
//! # use ark_relations::r1cs::*;
110+
//! # use ark_relations::gr1cs::*;
111111
//! # use ark_r1cs_std::prelude::*;
112112
//! # use ark_bls12_377::{*, constraints::*};
113113
//!

curves/bn254/src/constraints/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
//! One can perform standard algebraic operations on `FBaseVar`:
1111
//!
1212
//! ```
13-
//! # fn main() -> Result<(), ark_relations::r1cs::SynthesisError> {
13+
//! # fn main() -> Result<(), ark_relations::gr1cs::SynthesisError> {
1414
//! use ark_std::UniformRand;
15-
//! use ark_relations::r1cs::*;
15+
//! use ark_relations::gr1cs::*;
1616
//! use ark_r1cs_std::prelude::*;
1717
//! use ark_bn254::{*, constraints::*};
1818
//!
@@ -59,9 +59,9 @@
5959
//! One can also perform standard algebraic operations on `GVar`:
6060
//!
6161
//! ```
62-
//! # fn main() -> Result<(), ark_relations::r1cs::SynthesisError> {
62+
//! # fn main() -> Result<(), ark_relations::gr1cs::SynthesisError> {
6363
//! # use ark_std::UniformRand;
64-
//! # use ark_relations::r1cs::*;
64+
//! # use ark_relations::gr1cs::*;
6565
//! # use ark_r1cs_std::prelude::*;
6666
//! # use ark_bn254::{*, constraints::*};
6767
//!

curves/curve-constraint-tests/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ extern crate ark_relations;
44
pub mod fields {
55
use ark_ff::{BitIteratorLE, Field, PrimeField, UniformRand};
66
use ark_r1cs_std::prelude::*;
7-
use ark_relations::r1cs::{ConstraintSystem, SynthesisError};
7+
use ark_relations::gr1cs::{ConstraintSystem, SynthesisError};
88
use ark_std::{test_rng, vec::*};
99

1010
pub fn field_test<F, ConstraintF, AF>() -> Result<(), SynthesisError>
@@ -225,7 +225,7 @@ pub mod curves {
225225
AdditiveGroup, CurveGroup,
226226
};
227227
use ark_ff::{BitIteratorLE, Field, One, PrimeField};
228-
use ark_relations::r1cs::{ConstraintSystem, SynthesisError};
228+
use ark_relations::gr1cs::{ConstraintSystem, SynthesisError};
229229
use ark_std::{test_rng, vec::*, UniformRand};
230230

231231
use ark_r1cs_std::{fields::emulated_fp::EmulatedFpVar, prelude::*};
@@ -533,7 +533,7 @@ pub mod pairing {
533533
};
534534
use ark_ff::{BitIteratorLE, Field, PrimeField};
535535
use ark_r1cs_std::prelude::*;
536-
use ark_relations::r1cs::{ConstraintSystem, SynthesisError};
536+
use ark_relations::gr1cs::{ConstraintSystem, SynthesisError};
537537
use ark_std::{test_rng, vec::*, UniformRand};
538538

539539
#[allow(dead_code)]

curves/ed_on_bls12_377/src/constraints/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
//! One can perform standard algebraic operations on `FqVar`:
1111
//!
1212
//! ```
13-
//! # fn main() -> Result<(), ark_relations::r1cs::SynthesisError> {
13+
//! # fn main() -> Result<(), ark_relations::gr1cs::SynthesisError> {
1414
//! use ark_std::UniformRand;
15-
//! use ark_relations::r1cs::*;
15+
//! use ark_relations::gr1cs::*;
1616
//! use ark_r1cs_std::prelude::*;
1717
//! use ark_ed_on_bls12_377::{*, constraints::*};
1818
//!
@@ -59,9 +59,9 @@
5959
//! One can also perform standard algebraic operations on `EdwardsVar`:
6060
//!
6161
//! ```
62-
//! # fn main() -> Result<(), ark_relations::r1cs::SynthesisError> {
62+
//! # fn main() -> Result<(), ark_relations::gr1cs::SynthesisError> {
6363
//! # use ark_std::UniformRand;
64-
//! # use ark_relations::r1cs::*;
64+
//! # use ark_relations::gr1cs::*;
6565
//! # use ark_r1cs_std::prelude::*;
6666
//! # use ark_ed_on_bls12_377::{*, constraints::*};
6767
//!

curves/ed_on_bls12_381/src/constraints/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
//! One can perform standard algebraic operations on `FqVar`:
1111
//!
1212
//! ```
13-
//! # fn main() -> Result<(), ark_relations::r1cs::SynthesisError> {
13+
//! # fn main() -> Result<(), ark_relations::gr1cs::SynthesisError> {
1414
//! use ark_std::UniformRand;
15-
//! use ark_relations::r1cs::*;
15+
//! use ark_relations::gr1cs::*;
1616
//! use ark_r1cs_std::prelude::*;
1717
//! use ark_ed_on_bls12_381::{*, constraints::*};
1818
//!
@@ -59,9 +59,9 @@
5959
//! One can also perform standard algebraic operations on `EdwardsVar`:
6060
//!
6161
//! ```
62-
//! # fn main() -> Result<(), ark_relations::r1cs::SynthesisError> {
62+
//! # fn main() -> Result<(), ark_relations::gr1cs::SynthesisError> {
6363
//! # use ark_std::UniformRand;
64-
//! # use ark_relations::r1cs::*;
64+
//! # use ark_relations::gr1cs::*;
6565
//! # use ark_r1cs_std::prelude::*;
6666
//! # use ark_ed_on_bls12_381::{*, constraints::*};
6767
//!

curves/ed_on_bls12_381_bandersnatch/src/constraints/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
//! One can perform standard algebraic operations on `FqVar`:
1111
//!
1212
//! ```
13-
//! # fn main() -> Result<(), ark_relations::r1cs::SynthesisError> {
13+
//! # fn main() -> Result<(), ark_relations::gr1cs::SynthesisError> {
1414
//! use ark_std::UniformRand;
15-
//! use ark_relations::r1cs::*;
15+
//! use ark_relations::gr1cs::*;
1616
//! use ark_r1cs_std::prelude::*;
1717
//! use ark_ed_on_bls12_381_bandersnatch::{*, constraints::*};
1818
//!
@@ -59,9 +59,9 @@
5959
//! One can also perform standard algebraic operations on `EdwardsVar`:
6060
//!
6161
//! ```
62-
//! # fn main() -> Result<(), ark_relations::r1cs::SynthesisError> {
62+
//! # fn main() -> Result<(), ark_relations::gr1cs::SynthesisError> {
6363
//! # use ark_std::UniformRand;
64-
//! # use ark_relations::r1cs::*;
64+
//! # use ark_relations::gr1cs::*;
6565
//! # use ark_r1cs_std::prelude::*;
6666
//! # use ark_ed_on_bls12_381_bandersnatch::{*, constraints::*};
6767
//!

curves/ed_on_bn254/src/constraints/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
//! One can perform standard algebraic operations on `FqVar`:
1111
//!
1212
//! ```
13-
//! # fn main() -> Result<(), ark_relations::r1cs::SynthesisError> {
13+
//! # fn main() -> Result<(), ark_relations::gr1cs::SynthesisError> {
1414
//! use ark_std::UniformRand;
15-
//! use ark_relations::r1cs::*;
15+
//! use ark_relations::gr1cs::*;
1616
//! use ark_r1cs_std::prelude::*;
1717
//! use ark_ed_on_bn254::{*, constraints::*};
1818
//!
@@ -59,9 +59,9 @@
5959
//! One can also perform standard algebraic operations on `EdwardsVar`:
6060
//!
6161
//! ```
62-
//! # fn main() -> Result<(), ark_relations::r1cs::SynthesisError> {
62+
//! # fn main() -> Result<(), ark_relations::gr1cs::SynthesisError> {
6363
//! # use ark_std::UniformRand;
64-
//! # use ark_relations::r1cs::*;
64+
//! # use ark_relations::gr1cs::*;
6565
//! # use ark_r1cs_std::prelude::*;
6666
//! # use ark_ed_on_bn254::{*, constraints::*};
6767
//!

curves/ed_on_bw6_761/src/constraints/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
//! One can perform standard algebraic operations on `FqVar`:
1111
//!
1212
//! ```
13-
//! # fn main() -> Result<(), ark_relations::r1cs::SynthesisError> {
13+
//! # fn main() -> Result<(), ark_relations::gr1cs::SynthesisError> {
1414
//! use ark_std::UniformRand;
15-
//! use ark_relations::r1cs::*;
15+
//! use ark_relations::gr1cs::*;
1616
//! use ark_r1cs_std::prelude::*;
1717
//! use ark_ed_on_bw6_761::{*, constraints::*};
1818
//!
@@ -59,9 +59,9 @@
5959
//! One can also perform standard algebraic operations on `EdwardsVar`:
6060
//!
6161
//! ```
62-
//! # fn main() -> Result<(), ark_relations::r1cs::SynthesisError> {
62+
//! # fn main() -> Result<(), ark_relations::gr1cs::SynthesisError> {
6363
//! # use ark_std::UniformRand;
64-
//! # use ark_relations::r1cs::*;
64+
//! # use ark_relations::gr1cs::*;
6565
//! # use ark_r1cs_std::prelude::*;
6666
//! # use ark_ed_on_bw6_761::{*, constraints::*};
6767
//!

curves/ed_on_cp6_782/src/constraints/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
//! One can perform standard algebraic operations on `FqVar`:
1212
//!
1313
//! ```
14-
//! # fn main() -> Result<(), ark_relations::r1cs::SynthesisError> {
14+
//! # fn main() -> Result<(), ark_relations::gr1cs::SynthesisError> {
1515
//! use ark_std::UniformRand;
16-
//! use ark_relations::r1cs::*;
16+
//! use ark_relations::gr1cs::*;
1717
//! use ark_r1cs_std::prelude::*;
1818
//! use ark_ed_on_cp6_782::{*, constraints::*};
1919
//!
@@ -60,9 +60,9 @@
6060
//! One can also perform standard algebraic operations on `EdwardsVar`:
6161
//!
6262
//! ```
63-
//! # fn main() -> Result<(), ark_relations::r1cs::SynthesisError> {
63+
//! # fn main() -> Result<(), ark_relations::gr1cs::SynthesisError> {
6464
//! # use ark_std::UniformRand;
65-
//! # use ark_relations::r1cs::*;
65+
//! # use ark_relations::gr1cs::*;
6666
//! # use ark_r1cs_std::prelude::*;
6767
//! # use ark_ed_on_cp6_782::{*, constraints::*};
6868
//!

0 commit comments

Comments
 (0)