mirror of
https://github.com/arnaucube/ark-curves-cherry-picked.git
synced 2026-01-12 08:51:36 +01:00
Upgrade for algebra/365 (#92)
* Upgrade for algebra/365 * Merge fix * Fix
This commit is contained in:
@@ -9,6 +9,12 @@ pub struct Parameters;
|
||||
impl ModelParameters for Parameters {
|
||||
type BaseField = Fq;
|
||||
type ScalarField = Fr;
|
||||
|
||||
/// COFACTOR = 1
|
||||
const COFACTOR: &'static [u64] = &[0x1];
|
||||
|
||||
/// COFACTOR_INV = COFACTOR^{-1} mod r = 1
|
||||
const COFACTOR_INV: Fr = field_new!(Fr, "1");
|
||||
}
|
||||
|
||||
impl SWModelParameters for Parameters {
|
||||
@@ -18,12 +24,6 @@ impl SWModelParameters for Parameters {
|
||||
/// COEFF_B = 3
|
||||
const COEFF_B: Fq = field_new!(Fq, "3");
|
||||
|
||||
/// COFACTOR = 1
|
||||
const COFACTOR: &'static [u64] = &[0x1];
|
||||
|
||||
/// COFACTOR_INV = COFACTOR^{-1} mod r = 1
|
||||
const COFACTOR_INV: Fr = field_new!(Fr, "1");
|
||||
|
||||
/// AFFINE_GENERATOR_COEFFS = (G1_GENERATOR_X, G1_GENERATOR_Y)
|
||||
const AFFINE_GENERATOR_COEFFS: (Self::BaseField, Self::BaseField) =
|
||||
(G1_GENERATOR_X, G1_GENERATOR_Y);
|
||||
|
||||
@@ -9,20 +9,6 @@ pub struct Parameters;
|
||||
impl ModelParameters for Parameters {
|
||||
type BaseField = Fq2;
|
||||
type ScalarField = Fr;
|
||||
}
|
||||
|
||||
impl SWModelParameters for Parameters {
|
||||
/// COEFF_A = [0, 0]
|
||||
#[rustfmt::skip]
|
||||
const COEFF_A: Fq2 = field_new!(Fq2, field_new!(Fq, "0"), field_new!(Fq, "0"));
|
||||
|
||||
/// COEFF_B = 3/(u+9)
|
||||
/// = (19485874751759354771024239261021720505790618469301721065564631296452457478373, 266929791119991161246907387137283842545076965332900288569378510910307636690)
|
||||
#[rustfmt::skip]
|
||||
const COEFF_B: Fq2 = field_new!(Fq2,
|
||||
field_new!(Fq, "19485874751759354771024239261021720505790618469301721065564631296452457478373"),
|
||||
field_new!(Fq, "266929791119991161246907387137283842545076965332900288569378510910307636690"),
|
||||
);
|
||||
|
||||
/// COFACTOR = (36 * X^4) + (36 * X^3) + (30 * X^2) + 6*X + 1
|
||||
/// = 21888242871839275222246405745257275088844257914179612981679871602714643921549
|
||||
@@ -37,6 +23,20 @@ impl SWModelParameters for Parameters {
|
||||
/// COFACTOR_INV = COFACTOR^{-1} mod r
|
||||
#[rustfmt::skip]
|
||||
const COFACTOR_INV: Fr = field_new!(Fr, "10944121435919637613327163357776759465618812564592884533313067514031822496649");
|
||||
}
|
||||
|
||||
impl SWModelParameters for Parameters {
|
||||
/// COEFF_A = [0, 0]
|
||||
#[rustfmt::skip]
|
||||
const COEFF_A: Fq2 = field_new!(Fq2, field_new!(Fq, "0"), field_new!(Fq, "0"));
|
||||
|
||||
/// COEFF_B = 3/(u+9)
|
||||
/// = (19485874751759354771024239261021720505790618469301721065564631296452457478373, 266929791119991161246907387137283842545076965332900288569378510910307636690)
|
||||
#[rustfmt::skip]
|
||||
const COEFF_B: Fq2 = field_new!(Fq2,
|
||||
field_new!(Fq, "19485874751759354771024239261021720505790618469301721065564631296452457478373"),
|
||||
field_new!(Fq, "266929791119991161246907387137283842545076965332900288569378510910307636690"),
|
||||
);
|
||||
|
||||
/// AFFINE_GENERATOR_COEFFS = (G2_GENERATOR_X, G2_GENERATOR_Y)
|
||||
const AFFINE_GENERATOR_COEFFS: (Self::BaseField, Self::BaseField) =
|
||||
|
||||
Reference in New Issue
Block a user