diff --git a/Nargo.toml b/Nargo.toml index 9c488c9..f6fe8f3 100644 --- a/Nargo.toml +++ b/Nargo.toml @@ -5,5 +5,5 @@ authors = [""] compiler_version = ">=0.36.0" [dependencies] -bignum = {tag = "v0.4.1", git = "https://github.com/noir-lang/noir-bignum"} -sort = {tag = "v0.2.0", git = "https://github.com/noir-lang/noir_sort"} +bignum = { tag = "v0.4.2", git = "https://github.com/noir-lang/noir-bignum" } +sort = { tag = "v0.2.0", git = "https://github.com/noir-lang/noir_sort" } diff --git a/src/bigcurve_test.nr b/src/bigcurve_test.nr index 8c01ad7..0c0dfa5 100644 --- a/src/bigcurve_test.nr +++ b/src/bigcurve_test.nr @@ -3,12 +3,12 @@ use dep::bignum::BigNum; use crate::BigCurve; use crate::curve_jac; -use crate::curve_jac::JTranscript; use crate::curve_jac::AffineTranscript; use crate::curve_jac::CurveJ; -use crate::scalar_field::ScalarField; +use crate::curve_jac::JTranscript; +use crate::curves::bn254::{BN254, BN254Params, BN254Scalar}; use crate::PointTable; -use crate::curves::bn254::{BN254, BN254Scalar, BN254Params}; +use crate::scalar_field::ScalarField; type Fq = BigNum<3, 254, BN254_Fq_Params>; type BN254J = CurveJ; @@ -448,15 +448,15 @@ fn test_make_table() { use dep::bignum::fields::bn254Fq::BN254_Fq_Params; -use crate::curves::vesta::{Vesta, VestaFr, VestaScalar}; -use crate::curves::pallas::{Pallas, PallasFr, PallasScalar}; use crate::curves::bls12_377::{BLS12_377, BLS12_377Fr, BLS12_377Scalar}; use crate::curves::bls12_381::{BLS12_381, BLS12_381Fr, BLS12_381Scalar}; +use crate::curves::mnt4_753::{MNT4_753, MNT4_753Fr, MNT4_753Scalar}; +use crate::curves::mnt6_753::{MNT6_753, MNT6_753Fr, MNT6_753Scalar}; +use crate::curves::pallas::{Pallas, PallasFr, PallasScalar}; use crate::curves::secp256k1::{Secp256k1, Secp256k1Fr, Secp256k1Scalar}; use crate::curves::secp256r1::{Secp256r1, Secp256r1Fr, Secp256r1Scalar}; use crate::curves::secp384r1::{Secp384r1, Secp384r1Fr, Secp384r1Scalar}; -use crate::curves::mnt4_753::{MNT4_753, MNT4_753Fr, MNT4_753Scalar}; -use crate::curves::mnt6_753::{MNT6_753, MNT6_753Fr, MNT6_753Scalar}; +use crate::curves::vesta::{Vesta, VestaFr, VestaScalar}; //comptime fn comptime fn make_test( @@ -535,24 +535,3 @@ fn test_msm() { } } } - -#[make_test(quote{BN254}, quote{BigNum<3, 254, BN254_Fq_Params>}, quote{BN254Scalar})] -pub struct BN254GenTests {} -#[make_test(quote{Vesta}, quote{VestaFr}, quote{VestaScalar})] -pub struct VestaGenTests {} -#[make_test(quote{Pallas}, quote{PallasFr}, quote{PallasScalar})] -pub struct PallasGenTests {} -#[make_test(quote{BLS12_377}, quote{BLS12_377Fr}, quote{BLS12_377Scalar})] -pub struct BLS377GenTests {} -#[make_test(quote{BLS12_381}, quote{BLS12_381Fr}, quote{BLS12_381Scalar})] -pub struct BLS381GenTests {} -#[make_test(quote{Secp256k1}, quote{Secp256k1Fr}, quote{Secp256k1Scalar})] -pub struct Secp256k1GenTests {} -#[make_test(quote{Secp256r1}, quote{Secp256r1Fr}, quote{Secp256r1Scalar})] -pub struct Secp256r1GenTests {} -#[make_test(quote{Secp384r1}, quote{Secp384r1Fr}, quote{Secp384r1Scalar})] -pub struct Secp384r1GenTests {} -#[make_test(quote{MNT4_753}, quote{MNT4_753Fr}, quote{MNT4_753Scalar})] -pub struct MNT4GenTests {} -#[make_test(quote{MNT6_753}, quote{MNT6_753Fr}, quote{MNT6_753Scalar})] -pub struct MNT6GenTests {} diff --git a/src/curves/bls12_377.nr b/src/curves/bls12_377.nr index c99038e..7a9bb69 100644 --- a/src/curves/bls12_377.nr +++ b/src/curves/bls12_377.nr @@ -5,7 +5,7 @@ use crate::CurveParamsTrait; use crate::BigCurve; use crate::scalar_field::ScalarField; -global BLS12_377_SCALAR_SLICES = 64; +global BLS12_377_SCALAR_SLICES: u32 = 64; pub struct BLS12_377_Params {} impl CurveParamsTrait> for BLS12_377_Params { fn a() -> BigNum<4, 377, BLS12_377_Fq_Params> { diff --git a/src/curves/bls12_381.nr b/src/curves/bls12_381.nr index 1a876f0..478da6d 100644 --- a/src/curves/bls12_381.nr +++ b/src/curves/bls12_381.nr @@ -5,7 +5,7 @@ use crate::CurveParamsTrait; use crate::BigCurve; use crate::scalar_field::ScalarField; -global BLS12_381_SCALAR_SLICES = 64; +global BLS12_381_SCALAR_SLICES: u32 = 64; pub struct BLS12_381_Params {} impl CurveParamsTrait> for BLS12_381_Params { fn a() -> BigNum<4, 381, BLS12_381_Fq_Params> { diff --git a/src/curves/bn254.nr b/src/curves/bn254.nr index 040f51a..c173920 100644 --- a/src/curves/bn254.nr +++ b/src/curves/bn254.nr @@ -37,7 +37,7 @@ impl CurveParamsTrait> for BN254Params { } } -global BN254_SCALAR_SLICES = 64; +global BN254_SCALAR_SLICES: u32 = 64; pub type BN254 = BigCurve, BN254Params>; pub type BN254Scalar = ScalarField; pub type BN254Fq = BigNum<3, 254, BN254_Fq_Params>; diff --git a/src/curves/mnt4_753.nr b/src/curves/mnt4_753.nr index 6740318..e8dd019 100644 --- a/src/curves/mnt4_753.nr +++ b/src/curves/mnt4_753.nr @@ -5,7 +5,7 @@ use crate::CurveParamsTrait; use crate::BigCurve; use crate::scalar_field::ScalarField; -global MNT4_753_SCALAR_SLICES = 189; +global MNT4_753_SCALAR_SLICES: u32 = 189; pub struct MNT4_753_Params {} impl CurveParamsTrait> for MNT4_753_Params { fn a() -> BigNum<7, 753, MNT4_753_Fq_Params> { diff --git a/src/curves/mnt6_753.nr b/src/curves/mnt6_753.nr index e8fe010..c686a56 100644 --- a/src/curves/mnt6_753.nr +++ b/src/curves/mnt6_753.nr @@ -5,7 +5,7 @@ use crate::CurveParamsTrait; use crate::BigCurve; use crate::scalar_field::ScalarField; -global MNT6_753_SCALAR_SLICES = 189; +global MNT6_753_SCALAR_SLICES: u32 = 189; pub struct MNT6_753_Params {} impl CurveParamsTrait> for MNT6_753_Params { fn a() -> BigNum<7, 753, MNT6_753_Fq_Params> { diff --git a/src/curves/pallas.nr b/src/curves/pallas.nr index 36ae60f..5696995 100644 --- a/src/curves/pallas.nr +++ b/src/curves/pallas.nr @@ -5,7 +5,7 @@ use crate::BigCurve; use crate::scalar_field::ScalarField; use crate::CurveParamsTrait; -global PALLAS_SCALAR_SLICES = 64; +global PALLAS_SCALAR_SLICES: u32 = 64; pub struct Pallas_Params {} impl CurveParamsTrait> for Pallas_Params { diff --git a/src/curves/secp256k1.nr b/src/curves/secp256k1.nr index d286775..8af2fd1 100644 --- a/src/curves/secp256k1.nr +++ b/src/curves/secp256k1.nr @@ -5,7 +5,7 @@ use crate::CurveParamsTrait; use crate::BigCurve; use crate::scalar_field::ScalarField; -global SECP256k1_SCALAR_SLICES = 65; +global SECP256k1_SCALAR_SLICES: u32 = 65; pub struct Secp256k1_Params {} impl CurveParamsTrait> for Secp256k1_Params { fn a() -> BigNum<3, 256, Secp256k1_Fq_Params> { diff --git a/src/curves/secp384r1.nr b/src/curves/secp384r1.nr index 02c0689..8e6a074 100644 --- a/src/curves/secp384r1.nr +++ b/src/curves/secp384r1.nr @@ -89,7 +89,7 @@ impl CurveParamsTrait> for Secp384r1_Params } } -pub global SECP384r1_SCALAR_SLICES = 97; +pub global SECP384r1_SCALAR_SLICES: u32 = 97; pub type Secp384r1 = BigCurve, Secp384r1_Params>; pub type Secp384r1Scalar = ScalarField; pub type Secp384r1Fq = BigNum<4, 384, Secp384r1_Fq_Params>; diff --git a/src/curves/vesta.nr b/src/curves/vesta.nr index 3252a13..de33bd3 100644 --- a/src/curves/vesta.nr +++ b/src/curves/vesta.nr @@ -41,7 +41,7 @@ impl CurveParamsTrait> for Vesta_Params { } } -pub global VESTA_SCALAR_SLICES = 64; +pub global VESTA_SCALAR_SLICES: u32 = 64; pub type Vesta = BigCurve, Vesta_Params>; pub type VestaScalar = ScalarField; pub type VestaFq = BigNum<3, 255, Vesta_Fq_Params>;