Skip to content

Commit 529c8dc

Browse files
mmakermmagicianPratyush
authored
Import AdditiveGroup. (#122)
Co-authored-by: mmagician <[email protected]> Co-authored-by: Pratyush Mishra <[email protected]>
1 parent f85e92d commit 529c8dc

File tree

5 files changed

+26
-10
lines changed

5 files changed

+26
-10
lines changed

Cargo.toml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ keywords = ["zero-knowledge", "cryptography", "zkSNARK", "SNARK", "r1cs"]
1010
categories = ["cryptography"]
1111
include = ["Cargo.toml", "src", "README.md", "LICENSE-APACHE", "LICENSE-MIT"]
1212
license = "MIT/Apache-2.0"
13-
edition = "2018"
13+
edition = "2021"
14+
resolver = "2"
1415

1516
[dependencies]
1617
ark-ff = { version = "0.4.0", default-features = false }
@@ -20,8 +21,8 @@ ark-relations = { version = "0.4.0", default-features = false }
2021

2122
derivative = { version = "2", features = ["use_core"] }
2223
tracing = { version = "0.1", default-features = false, features = [ "attributes" ] }
23-
num-bigint = {version = "0.4", default-features = false }
24-
num-traits = {version = "0.2", default-features = false }
24+
num-bigint = { version = "0.4", default-features = false }
25+
num-traits = { version = "0.2", default-features = false }
2526
num-integer = { version = "0.1.44", default-features = false }
2627

2728
[dev-dependencies]
@@ -70,3 +71,17 @@ lto = "thin"
7071
incremental = true
7172
debug-assertions = true
7273
debug = true
74+
75+
[patch.crates-io]
76+
ark-ff = { git = "https://github.com/arkworks-rs/algebra/" }
77+
ark-ec = { git = "https://github.com/arkworks-rs/algebra/" }
78+
ark-poly = { git = "https://github.com/arkworks-rs/algebra/" }
79+
ark-serialize = { git = "https://github.com/arkworks-rs/algebra/" }
80+
ark-test-curves = { git = "https://github.com/arkworks-rs/algebra/" }
81+
ark-bls12-377 = { git = "https://github.com/arkworks-rs/curves/" }
82+
ark-bls12-381 = { git = "https://github.com/arkworks-rs/curves/" }
83+
ark-mnt4-298 = { git = "https://github.com/arkworks-rs/curves/" }
84+
ark-mnt4-753 = { git = "https://github.com/arkworks-rs/curves/" }
85+
ark-mnt6-298 = { git = "https://github.com/arkworks-rs/curves/" }
86+
ark-mnt6-753 = { git = "https://github.com/arkworks-rs/curves/" }
87+
ark-pallas = { git = "https://github.com/arkworks-rs/curves/" }

src/bits/boolean.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -956,7 +956,9 @@ impl<F: Field> CondSelectGadget<F> for Boolean<F> {
956956
mod test {
957957
use super::{AllocatedBool, Boolean};
958958
use crate::prelude::*;
959-
use ark_ff::{BitIteratorBE, BitIteratorLE, Field, One, PrimeField, UniformRand, Zero};
959+
use ark_ff::{
960+
AdditiveGroup, BitIteratorBE, BitIteratorLE, Field, One, PrimeField, UniformRand, Zero,
961+
};
960962
use ark_relations::r1cs::{ConstraintSystem, Namespace, SynthesisError};
961963
use ark_test_curves::bls12_381::Fr;
962964

src/groups/curves/short_weierstrass/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use ark_ec::{
44
},
55
AffineRepr, CurveGroup,
66
};
7-
use ark_ff::{BigInteger, BitIteratorBE, Field, One, PrimeField, Zero};
7+
use ark_ff::{AdditiveGroup, BigInteger, BitIteratorBE, Field, One, PrimeField, Zero};
88
use ark_relations::r1cs::{ConstraintSystemRef, Namespace, SynthesisError};
99
use ark_std::{borrow::Borrow, marker::PhantomData, ops::Mul};
1010
use non_zero_affine::NonZeroAffineVar;
@@ -838,7 +838,7 @@ where
838838
let (mut ge, iter) = if cofactor_weight < modulus_minus_1_weight {
839839
let ge = Self::new_variable_omit_prime_order_check(
840840
ark_relations::ns!(cs, "Witness without subgroup check with cofactor mul"),
841-
|| f().map(|g| g.borrow().into_affine().mul_by_cofactor_inv().into()),
841+
|| f().map(|g| g.into_affine().mul_by_cofactor_inv().into()),
842842
mode,
843843
)?;
844844
(

src/groups/curves/short_weierstrass/non_zero_affine.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use super::*;
2-
use ark_ec::Group;
2+
use ark_ec::AdditiveGroup;
33
use ark_std::ops::Add;
44

55
/// An affine representation of a prime order curve point that is guaranteed

src/groups/curves/twisted_edwards/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use ark_ec::{
33
Affine as TEAffine, MontCurveConfig as MontgomeryModelParameter,
44
Projective as TEProjective, TECurveConfig as TEModelParameters,
55
},
6-
AffineRepr, CurveGroup, Group,
6+
AdditiveGroup, AffineRepr, CurveGroup,
77
};
88
use ark_ff::{BigInteger, BitIteratorBE, Field, One, PrimeField, Zero};
99
use ark_relations::r1cs::{ConstraintSystemRef, Namespace, SynthesisError};
@@ -337,7 +337,6 @@ where
337337
.iter()
338338
.zip(segment_powers.borrow())
339339
{
340-
let base_power = base_power.borrow();
341340
let mut acc_power = *base_power;
342341
let mut coords = vec![];
343342
for _ in 0..4 {
@@ -609,7 +608,7 @@ where
609608
let (mut ge, iter) = if cofactor_weight < modulus_minus_1_weight {
610609
let ge = Self::new_variable_omit_prime_order_check(
611610
ark_relations::ns!(cs, "Witness without subgroup check with cofactor mul"),
612-
|| f().map(|g| g.borrow().into_affine().mul_by_cofactor_inv().into()),
611+
|| f().map(|g| g.into_affine().mul_by_cofactor_inv().into()),
613612
mode,
614613
)?;
615614
(

0 commit comments

Comments
 (0)