Skip to content

Commit

Permalink
Merge pull request #24 from mmagician/rebase-after-ec-models-refactor
Browse files Browse the repository at this point in the history
Move COFACTOR & COFACTOR_INV to ModelParameters
  • Loading branch information
drskalman authored Jan 6, 2022
2 parents 76b5f33 + 21ffa8f commit 2b14323
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions ec/src/hashing/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ const F127_ONE: F127 = field_new!(F127, "1");
struct TestSWUMapToCurveParams;

impl ModelParameters for TestSWUMapToCurveParams {
const COFACTOR: &'static [u64] = &[1];

#[rustfmt::skip]
const COFACTOR_INV: F127 = F127_ONE;

type BaseField = F127;
type ScalarField = F127;
}
Expand All @@ -131,11 +136,6 @@ impl SWModelParameters for TestSWUMapToCurveParams {
#[rustfmt::skip]
const COEFF_B: F127 = field_new!(F127, "63");

const COFACTOR: &'static [u64] = &[1];

#[rustfmt::skip]
const COFACTOR_INV: F127 = F127_ONE;

/// AFFINE_GENERATOR_COEFFS = (G1_GENERATOR_X, G1_GENERATOR_Y)
const AFFINE_GENERATOR_COEFFS: (Self::BaseField, Self::BaseField) =
(field_new!(F127, "62"), field_new!(F127, "70"));
Expand Down Expand Up @@ -238,6 +238,11 @@ struct TestSWU127MapToIsogenousCurveParams;
/// sage: E_isogenous.order()
/// 127
impl ModelParameters for TestSWU127MapToIsogenousCurveParams {
const COFACTOR: &'static [u64] = &[1];

#[rustfmt::skip]
const COFACTOR_INV: F127 = F127_ONE;

type BaseField = F127;
type ScalarField = F127;
}
Expand All @@ -252,11 +257,6 @@ impl SWModelParameters for TestSWU127MapToIsogenousCurveParams {
#[rustfmt::skip]
const COEFF_B: F127 = field_new!(F127, "124");

const COFACTOR: &'static [u64] = &[1];

#[rustfmt::skip]
const COFACTOR_INV: F127 = F127_ONE;

/// AFFINE_GENERATOR_COEFFS = (G1_GENERATOR_X, G1_GENERATOR_Y)
const AFFINE_GENERATOR_COEFFS: (Self::BaseField, Self::BaseField) =
(field_new!(F127, "84"), field_new!(F127, "2"));
Expand All @@ -276,6 +276,11 @@ impl SWUParams for TestSWU127MapToIsogenousCurveParams {
struct TestWBF127MapToCurveParams;

impl ModelParameters for TestWBF127MapToCurveParams {
const COFACTOR: &'static [u64] = &[1];

#[rustfmt::skip]
const COFACTOR_INV: F127 = F127_ONE;

type BaseField = F127;
type ScalarField = F127;
}
Expand All @@ -290,11 +295,6 @@ impl SWModelParameters for TestWBF127MapToCurveParams {
#[rustfmt::skip]
const COEFF_B: F127 = field_new!(F127, "3");

const COFACTOR: &'static [u64] = &[1];

#[rustfmt::skip]
const COFACTOR_INV: F127 = F127_ONE;

/// AFFINE_GENERATOR_COEFFS = (G1_GENERATOR_X, G1_GENERATOR_Y)
const AFFINE_GENERATOR_COEFFS: (Self::BaseField, Self::BaseField) =
(field_new!(F127, "62"), field_new!(F127, "70"));
Expand Down

0 comments on commit 2b14323

Please sign in to comment.