Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion src/curves/bls12_377.nr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use bignum::BigNum;

pub use bignum::{BLS12_377_Fq, BLS12_377_Fr};

global BLS12_377_SCALAR_SLICES: u32 = 64;
pub global BLS12_377_SCALAR_SLICES: u32 = 64;
pub struct BLS12_377_Params {}
impl CurveParamsTrait<BLS12_377_Fq> for BLS12_377_Params {
fn a() -> BLS12_377_Fq {
Expand Down
2 changes: 1 addition & 1 deletion src/curves/bls12_381.nr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::scalar_field::ScalarField;
use bignum::BigNum;
use bignum::BLS12_381_Fq;

global BLS12_381_SCALAR_SLICES: u32 = 64;
pub global BLS12_381_SCALAR_SLICES: u32 = 64;
pub struct BLS12_381_Params {}
impl CurveParamsTrait<BLS12_381_Fq> for BLS12_381_Params {
fn a() -> BLS12_381_Fq {
Expand Down
2 changes: 1 addition & 1 deletion src/curves/bn254.nr
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl CurveParamsTrait<BN254_Fq> for BN254Params {
}
}

global BN254_SCALAR_SLICES: u32 = 64;
pub global BN254_SCALAR_SLICES: u32 = 64;
pub type BN254 = BigCurve<BN254_Fq, BN254Params>;
pub type BN254Scalar = ScalarField<BN254_SCALAR_SLICES>;
// pub type Secp256r1Fr = BigNum<3, Secp256r1_Fr_Params>;
Expand Down
2 changes: 1 addition & 1 deletion src/curves/mnt4_753.nr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::scalar_field::ScalarField;
use bignum::BigNum;
pub use bignum::{MNT4_753_Fq, MNT4_753_Fr};

global MNT4_753_SCALAR_SLICES: u32 = 189;
pub global MNT4_753_SCALAR_SLICES: u32 = 189;
pub struct MNT4_753_Params {}
impl CurveParamsTrait<MNT4_753_Fq> for MNT4_753_Params {
fn a() -> MNT4_753_Fq {
Expand Down
2 changes: 1 addition & 1 deletion src/curves/mnt6_753.nr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::scalar_field::ScalarField;
use bignum::BigNum;
pub use bignum::{MNT6_753_Fq, MNT6_753_Fr};

global MNT6_753_SCALAR_SLICES: u32 = 189;
pub global MNT6_753_SCALAR_SLICES: u32 = 189;
pub struct MNT6_753_Params {}
impl CurveParamsTrait<MNT6_753_Fq> for MNT6_753_Params {
fn a() -> MNT6_753_Fq {
Expand Down
20 changes: 10 additions & 10 deletions src/curves/mod.nr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
pub(crate) mod pallas;
pub(crate) mod vesta;
pub(crate) mod bls12_377;
pub(crate) mod bls12_381;
pub(crate) mod secp256k1;
pub(crate) mod secp256r1;
pub(crate) mod secp384r1;
pub(crate) mod mnt4_753;
pub(crate) mod mnt6_753;
pub(crate) mod bn254;
pub mod pallas;
pub mod vesta;
pub mod bls12_377;
pub mod bls12_381;
pub mod secp256k1;
pub mod secp256r1;
pub mod secp384r1;
pub mod mnt4_753;
pub mod mnt6_753;
pub mod bn254;
2 changes: 1 addition & 1 deletion src/curves/pallas.nr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use bignum::BigNum;

pub use bignum::{Pallas_Fq, Pallas_Fr};

global PALLAS_SCALAR_SLICES: u32 = 64;
pub global PALLAS_SCALAR_SLICES: u32 = 64;

pub struct Pallas_Params {}
impl CurveParamsTrait<Pallas_Fq> for Pallas_Params {
Expand Down
2 changes: 1 addition & 1 deletion src/curves/secp256k1.nr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use bignum::BigNum;

pub use bignum::{Secp256k1_Fq, Secp256k1_Fr};

global SECP256k1_SCALAR_SLICES: u32 = 65;
pub global SECP256k1_SCALAR_SLICES: u32 = 65;
pub struct Secp256k1_Params {}

impl CurveParamsTrait<Secp256k1_Fq> for Secp256k1_Params {
Expand Down
7 changes: 4 additions & 3 deletions src/lib.nr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub(crate) mod scalar_field;
pub mod scalar_field;
pub(crate) mod curve_jac;
mod test_data;
mod bigcurve_test;
Expand All @@ -23,7 +23,7 @@ pub struct BigCurve<B, CurveParams> {
pub is_infinity: bool,
}

trait CurveParamsTrait<B: BigNum> {
pub trait CurveParamsTrait<B: BigNum> {
fn offset_generator() -> [B; 2];
fn offset_generator_final() -> [B; 2];
fn one() -> [B; 2];
Expand Down Expand Up @@ -92,7 +92,7 @@ impl<B: BigNum> PointTable<B> {
}
}

trait BigCurveTrait {
pub trait BigCurveTrait {
fn neg(self) -> Self;
fn point_at_infinity() -> Self;
fn offset_generator() -> Self;
Expand Down Expand Up @@ -417,6 +417,7 @@ where
[false],
);

// x3 = lambda * lambda - x2 - x1
bignum::bignum::evaluate_quadratic_expression(
[[lambda]],
[[false]],
Expand Down