mirror of
https://github.com/arnaucube/ark-curves-cherry-picked.git
synced 2026-01-08 15:01:29 +01:00
Adding AdditiveGroup and PrimeGroup (#159)
Co-authored-by: Michele Orrù <michele.orru@berkeley.edu> Co-authored-by: Weikeng Chen <w.k@berkeley.edu> Co-authored-by: Pratyush Mishra <pratyushmishra@berkeley.edu>
This commit is contained in:
committed by
GitHub
parent
5a41d7f27a
commit
32b487e7fd
8
.github/workflows/ci.yml
vendored
8
.github/workflows/ci.yml
vendored
@@ -164,11 +164,11 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install Rust (${{ matrix.rust }})
|
||||
- name: Install Rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
target: aarch64-unknown-none
|
||||
target: thumbv6m-none-eabi
|
||||
override: true
|
||||
|
||||
- uses: actions/cache@v2
|
||||
@@ -183,10 +183,10 @@ jobs:
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: check
|
||||
args: --examples --workspace --exclude ark-curve-constraint-tests --target aarch64-unknown-none
|
||||
args: --examples --workspace --exclude ark-curve-constraint-tests --target thumbv6m-none-eabi
|
||||
|
||||
- name: build
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
args: --workspace --exclude ark-curve-constraint-tests --target aarch64-unknown-none
|
||||
args: --workspace --exclude ark-curve-constraint-tests --target thumbv6m-none-eabi
|
||||
|
||||
@@ -71,4 +71,5 @@ ark-ec = { 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-algebra-test-templates = { git = "https://github.com/arkworks-rs/algebra/" }
|
||||
ark-r1cs-std = { git = "https://github.com/arkworks-rs/r1cs-std/" }
|
||||
ark-algebra-bench-templates = { git = "https://github.com/arkworks-rs/algebra/" }
|
||||
ark-r1cs-std = { git = "https://github.com/mmaker/ark-r1cs-std/", branch = "feature/additive-groups" }
|
||||
|
||||
@@ -10,7 +10,7 @@ use ark_ec::{
|
||||
},
|
||||
CurveConfig,
|
||||
};
|
||||
use ark_ff::{Field, MontFp, PrimeField, Zero};
|
||||
use ark_ff::{AdditiveGroup, Field, MontFp, PrimeField, Zero};
|
||||
use ark_std::{ops::Neg, One};
|
||||
|
||||
use super::g1_swu_iso::{SwuIsoConfig, ISOGENY_MAP_TO_G1};
|
||||
|
||||
@@ -4,10 +4,10 @@ use ark_ec::{
|
||||
hashing::curve_maps::wb::{IsogenyMap, WBConfig},
|
||||
models::CurveConfig,
|
||||
short_weierstrass::{Affine, Projective, SWCurveConfig},
|
||||
AffineRepr, CurveGroup, Group,
|
||||
AffineRepr, CurveGroup, PrimeGroup,
|
||||
};
|
||||
|
||||
use ark_ff::{Field, MontFp, Zero};
|
||||
use ark_ff::{AdditiveGroup, Field, MontFp, Zero};
|
||||
use ark_std::ops::Neg;
|
||||
|
||||
use crate::*;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
use ark_algebra_bench_templates::*;
|
||||
|
||||
use ark_bls12_381::{
|
||||
fq::Fq, fq2::Fq2, fr::Fr, Bls12_381, Fq12, G1Projective as G1, G2Projective as G2,
|
||||
};
|
||||
|
||||
@@ -4,9 +4,9 @@ use ark_ec::{
|
||||
hashing::curve_maps::wb::{IsogenyMap, WBConfig},
|
||||
models::CurveConfig,
|
||||
short_weierstrass::{Affine, SWCurveConfig},
|
||||
AffineRepr, Group,
|
||||
AffineRepr, PrimeGroup,
|
||||
};
|
||||
use ark_ff::{Field, MontFp, PrimeField, Zero};
|
||||
use ark_ff::{AdditiveGroup, MontFp, PrimeField, Zero};
|
||||
use ark_serialize::{Compress, SerializationError};
|
||||
use ark_std::{ops::Neg, One};
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@ use ark_ec::{
|
||||
hashing::curve_maps::wb::{IsogenyMap, WBConfig},
|
||||
models::CurveConfig,
|
||||
short_weierstrass::{Affine, Projective, SWCurveConfig},
|
||||
AffineRepr, CurveGroup, Group,
|
||||
AffineRepr, CurveGroup, PrimeGroup,
|
||||
};
|
||||
use ark_ff::{Field, MontFp, Zero};
|
||||
use ark_ff::{AdditiveGroup, Field, MontFp, Zero};
|
||||
use ark_serialize::{Compress, SerializationError};
|
||||
|
||||
use super::{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use ark_algebra_test_templates::*;
|
||||
use ark_ec::{AffineRepr, CurveGroup, Group};
|
||||
use ark_ec::{AffineRepr, CurveGroup, PrimeGroup};
|
||||
use ark_ff::{fields::Field, One, UniformRand, Zero};
|
||||
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize, Compress, Validate};
|
||||
use ark_std::{rand::Rng, test_rng, vec};
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
use ark_algebra_test_templates::*;
|
||||
use ark_ec::AdditiveGroup;
|
||||
use ark_ff::{
|
||||
biginteger::{BigInt, BigInteger, BigInteger384},
|
||||
fields::{FftField, Field, Fp12Config, Fp2Config, Fp6Config, PrimeField},
|
||||
|
||||
@@ -2,7 +2,7 @@ use ark_ec::{
|
||||
models::{short_weierstrass::SWCurveConfig, CurveConfig},
|
||||
short_weierstrass::Affine,
|
||||
};
|
||||
use ark_ff::{Field, MontFp, Zero};
|
||||
use ark_ff::{AdditiveGroup, Field, MontFp, Zero};
|
||||
|
||||
use crate::{Fq, Fr};
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ use ark_ec::{
|
||||
models::{short_weierstrass::SWCurveConfig, CurveConfig},
|
||||
short_weierstrass::Affine,
|
||||
};
|
||||
use ark_ff::{Field, MontFp, Zero};
|
||||
use ark_ff::{AdditiveGroup, MontFp, Zero};
|
||||
|
||||
use crate::{Fq, Fq2, Fr};
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ use ark_ec::{
|
||||
models::{short_weierstrass::SWCurveConfig, CurveConfig},
|
||||
short_weierstrass::{Affine, Projective},
|
||||
};
|
||||
use ark_ff::{Field, MontFp};
|
||||
use ark_ff::{AdditiveGroup, MontFp};
|
||||
|
||||
use crate::{Fq, Fr};
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ use ark_ec::{
|
||||
models::{short_weierstrass::SWCurveConfig, CurveConfig},
|
||||
short_weierstrass::{Affine, Projective},
|
||||
};
|
||||
use ark_ff::{Field, MontFp};
|
||||
use ark_ff::{AdditiveGroup, MontFp};
|
||||
|
||||
use crate::{Fq, Fr};
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use ark_ff::{
|
||||
fields::fp3::{Fp3, Fp3Config},
|
||||
Field, MontFp,
|
||||
AdditiveGroup, Field, MontFp,
|
||||
};
|
||||
|
||||
use crate::Fq;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use ark_ff::{
|
||||
fields::fp6_2over3::{Fp6, Fp6Config},
|
||||
Field, MontFp,
|
||||
AdditiveGroup, Field, MontFp,
|
||||
};
|
||||
|
||||
use crate::{Fq, Fq3, Fq3Config};
|
||||
|
||||
@@ -3,7 +3,7 @@ use ark_ec::{
|
||||
short_weierstrass::{Affine, Projective, SWCurveConfig},
|
||||
AffineRepr, CurveGroup,
|
||||
};
|
||||
use ark_ff::{Field, MontFp};
|
||||
use ark_ff::{AdditiveGroup, MontFp};
|
||||
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
|
||||
use ark_std::vec::Vec;
|
||||
|
||||
|
||||
@@ -3,7 +3,8 @@ use ark_ec::{
|
||||
pairing::{MillerLoopOutput, Pairing, PairingOutput},
|
||||
};
|
||||
use ark_ff::{
|
||||
biginteger::BigInteger832, BigInt, BitIteratorBE, CyclotomicMultSubgroup, Field, One,
|
||||
biginteger::BigInteger832, AdditiveGroup, BigInt, BitIteratorBE, CyclotomicMultSubgroup, Field,
|
||||
One,
|
||||
};
|
||||
use itertools::Itertools;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use ark_ff::{
|
||||
fields::fp3::{Fp3, Fp3Config},
|
||||
Field, MontFp,
|
||||
AdditiveGroup, Field, MontFp,
|
||||
};
|
||||
|
||||
use crate::Fq;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use ark_ff::{
|
||||
fields::fp6_2over3::{Fp6, Fp6Config},
|
||||
Field, MontFp,
|
||||
AdditiveGroup, Field, MontFp,
|
||||
};
|
||||
|
||||
use crate::{Fq, Fq3, Fq3Config};
|
||||
|
||||
@@ -225,7 +225,7 @@ pub mod fields {
|
||||
pub mod curves {
|
||||
use ark_ec::{
|
||||
short_weierstrass::Projective as SWProjective, twisted_edwards::Projective as TEProjective,
|
||||
CurveGroup, Group,
|
||||
AdditiveGroup, CurveGroup,
|
||||
};
|
||||
use ark_ff::{BitIteratorLE, Field, One, PrimeField};
|
||||
use ark_relations::r1cs::{ConstraintSystem, SynthesisError};
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use crate::{Fq, Fr};
|
||||
use ark_algebra_test_templates::*;
|
||||
use ark_ec::AdditiveGroup;
|
||||
use ark_ff::{
|
||||
biginteger::BigInteger256 as BigInteger,
|
||||
fields::{Field, LegendreSymbol::*},
|
||||
|
||||
@@ -3,7 +3,7 @@ use ark_ec::{
|
||||
short_weierstrass::{self, SWCurveConfig},
|
||||
twisted_edwards::{Affine, MontCurveConfig, Projective, TECurveConfig},
|
||||
};
|
||||
use ark_ff::{Field, MontFp};
|
||||
use ark_ff::{AdditiveGroup, MontFp};
|
||||
|
||||
use crate::{Fq, Fr};
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use crate::{Fq, Fr};
|
||||
use ark_algebra_test_templates::*;
|
||||
use ark_ec::AdditiveGroup;
|
||||
use ark_ff::{
|
||||
biginteger::BigInteger256 as BigInteger,
|
||||
fields::{Field, LegendreSymbol::*},
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
use ark_algebra_test_templates::*;
|
||||
use ark_ec::AdditiveGroup;
|
||||
use ark_ff::{
|
||||
biginteger::BigInteger256 as BigInteger,
|
||||
fields::{Field, LegendreSymbol::*},
|
||||
|
||||
@@ -3,7 +3,7 @@ use ark_ec::{
|
||||
mnt4::MNT4Config,
|
||||
models::{short_weierstrass::SWCurveConfig, CurveConfig},
|
||||
};
|
||||
use ark_ff::{Field, MontFp};
|
||||
use ark_ff::{AdditiveGroup, MontFp};
|
||||
|
||||
use crate::{Fq, Fq2, Fr, G1_COEFF_A_NON_RESIDUE};
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use ark_ec::models::mnt4::{MNT4Config, MNT4};
|
||||
use ark_ff::{biginteger::BigInteger320, BigInt, Field, MontFp};
|
||||
use ark_ff::{biginteger::BigInteger320, AdditiveGroup, BigInt, Field, MontFp};
|
||||
|
||||
use crate::{Fq, Fq2, Fq2Config, Fq4Config, Fr};
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use ark_ff::{
|
||||
fields::fp4::{Fp4, Fp4Config},
|
||||
Field, MontFp,
|
||||
AdditiveGroup, Field, MontFp,
|
||||
};
|
||||
|
||||
use crate::{Fq, Fq2, Fq2Config};
|
||||
|
||||
@@ -3,7 +3,7 @@ use ark_ec::{
|
||||
mnt4::MNT4Config,
|
||||
models::{short_weierstrass::SWCurveConfig, CurveConfig},
|
||||
};
|
||||
use ark_ff::{Field, MontFp};
|
||||
use ark_ff::{AdditiveGroup, MontFp};
|
||||
|
||||
use crate::{Fq, Fq2, Fr, G1_COEFF_A_NON_RESIDUE};
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use ark_ec::models::mnt4::{MNT4Config, MNT4};
|
||||
use ark_ff::{
|
||||
biginteger::{BigInt, BigInteger768},
|
||||
Field, Fp2, MontFp,
|
||||
AdditiveGroup, Field, Fp2, MontFp,
|
||||
};
|
||||
|
||||
use crate::{Fq, Fq2Config, Fq4Config, Fr};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use ark_ff::{
|
||||
fields::fp4::{Fp4, Fp4Config},
|
||||
Field, MontFp,
|
||||
AdditiveGroup, Field, MontFp,
|
||||
};
|
||||
|
||||
use crate::{Fq, Fq2, Fq2Config};
|
||||
|
||||
@@ -3,7 +3,7 @@ use ark_ec::{
|
||||
mnt6::MNT6Config,
|
||||
models::{short_weierstrass::SWCurveConfig, CurveConfig},
|
||||
};
|
||||
use ark_ff::{Field, MontFp};
|
||||
use ark_ff::{AdditiveGroup, MontFp};
|
||||
|
||||
use crate::{g1, Fq, Fq3, Fr};
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ use ark_ec::{
|
||||
models::mnt6::{MNT6Config, MNT6},
|
||||
short_weierstrass::SWCurveConfig,
|
||||
};
|
||||
use ark_ff::{biginteger::BigInteger320, BigInt, Field, Fp3};
|
||||
use ark_ff::{biginteger::BigInteger320, AdditiveGroup, BigInt, Field, Fp3};
|
||||
|
||||
use crate::{Fq, Fq3Config, Fq6Config, Fr};
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use ark_ff::{
|
||||
fields::fp3::{Fp3, Fp3Config},
|
||||
Field, MontFp,
|
||||
AdditiveGroup, Field, MontFp,
|
||||
};
|
||||
|
||||
use crate::fq::Fq;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use ark_ff::{
|
||||
fields::fp6_2over3::{Fp6, Fp6Config},
|
||||
Field, MontFp,
|
||||
AdditiveGroup, Field, MontFp,
|
||||
};
|
||||
|
||||
use crate::{Fq, Fq3, Fq3Config};
|
||||
|
||||
@@ -3,7 +3,7 @@ use ark_ec::{
|
||||
mnt6::MNT6Config,
|
||||
models::{short_weierstrass::SWCurveConfig, CurveConfig},
|
||||
};
|
||||
use ark_ff::{Field, MontFp};
|
||||
use ark_ff::{AdditiveGroup, MontFp};
|
||||
|
||||
use crate::{g1, Fq, Fq3, Fr};
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ use ark_ec::models::{
|
||||
mnt6::{MNT6Config, MNT6},
|
||||
short_weierstrass::SWCurveConfig,
|
||||
};
|
||||
use ark_ff::{biginteger::BigInteger768, BigInt, Field, Fp3};
|
||||
use ark_ff::{biginteger::BigInteger768, AdditiveGroup, BigInt, Field, Fp3};
|
||||
|
||||
use crate::{Fq, Fq3Config, Fq6Config, Fr};
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use ark_ff::{
|
||||
fields::fp3::{Fp3, Fp3Config},
|
||||
Field, MontFp,
|
||||
AdditiveGroup, Field, MontFp,
|
||||
};
|
||||
|
||||
use crate::fq::Fq;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use ark_ff::{
|
||||
fields::fp6_2over3::{Fp6, Fp6Config},
|
||||
Field, MontFp,
|
||||
AdditiveGroup, Field, MontFp,
|
||||
};
|
||||
|
||||
use crate::{Fq, Fq3, Fq3Config};
|
||||
|
||||
@@ -2,7 +2,7 @@ use ark_ec::{
|
||||
models::CurveConfig,
|
||||
short_weierstrass::{self as sw, SWCurveConfig},
|
||||
};
|
||||
use ark_ff::{Field, MontFp, Zero};
|
||||
use ark_ff::{AdditiveGroup, Field, MontFp, Zero};
|
||||
|
||||
use crate::{fq::Fq, fr::Fr};
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ use ark_ec::{
|
||||
models::CurveConfig,
|
||||
short_weierstrass::{self as sw, SWCurveConfig},
|
||||
};
|
||||
use ark_ff::{Field, MontFp, Zero};
|
||||
use ark_ff::{AdditiveGroup, Field, MontFp, Zero};
|
||||
|
||||
use crate::{fq::Fq, fr::Fr};
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ use ark_ec::{
|
||||
models::CurveConfig,
|
||||
short_weierstrass::{self as sw, SWCurveConfig},
|
||||
};
|
||||
use ark_ff::{Field, MontFp, Zero};
|
||||
use ark_ff::{AdditiveGroup, Field, MontFp, Zero};
|
||||
|
||||
use crate::{fq::Fq, fr::Fr};
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ use ark_ec::{
|
||||
models::CurveConfig,
|
||||
short_weierstrass::{self as sw, SWCurveConfig},
|
||||
};
|
||||
use ark_ff::{Field, MontFp, Zero};
|
||||
use ark_ff::{AdditiveGroup, Field, MontFp, Zero};
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
Reference in New Issue
Block a user