|
@ -18,6 +18,14 @@ pub struct Parameters; |
|
|
impl ModelParameters for Parameters {
|
|
|
impl ModelParameters for Parameters {
|
|
|
type BaseField = Fq;
|
|
|
type BaseField = Fq;
|
|
|
type ScalarField = Fr;
|
|
|
type ScalarField = Fr;
|
|
|
|
|
|
|
|
|
|
|
|
/// COFACTOR = (x - 1)^2 / 3 = 30631250834960419227450344600217059328
|
|
|
|
|
|
const COFACTOR: &'static [u64] = &[0x0, 0x170b5d4430000000];
|
|
|
|
|
|
|
|
|
|
|
|
/// COFACTOR_INV = COFACTOR^{-1} mod r
|
|
|
|
|
|
/// = 5285428838741532253824584287042945485047145357130994810877
|
|
|
|
|
|
#[rustfmt::skip]
|
|
|
|
|
|
const COFACTOR_INV: Fr = field_new!(Fr, "5285428838741532253824584287042945485047145357130994810877");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
impl SWModelParameters for Parameters {
|
|
|
impl SWModelParameters for Parameters {
|
|
@ -28,14 +36,6 @@ impl SWModelParameters for Parameters { |
|
|
#[rustfmt::skip]
|
|
|
#[rustfmt::skip]
|
|
|
const COEFF_B: Fq = FQ_ONE;
|
|
|
const COEFF_B: Fq = FQ_ONE;
|
|
|
|
|
|
|
|
|
/// COFACTOR = (x - 1)^2 / 3 = 30631250834960419227450344600217059328
|
|
|
|
|
|
const COFACTOR: &'static [u64] = &[0x0, 0x170b5d4430000000];
|
|
|
|
|
|
|
|
|
|
|
|
/// COFACTOR_INV = COFACTOR^{-1} mod r
|
|
|
|
|
|
/// = 5285428838741532253824584287042945485047145357130994810877
|
|
|
|
|
|
#[rustfmt::skip]
|
|
|
|
|
|
const COFACTOR_INV: Fr = field_new!(Fr, "5285428838741532253824584287042945485047145357130994810877");
|
|
|
|
|
|
|
|
|
|
|
|
/// AFFINE_GENERATOR_COEFFS = (G1_GENERATOR_X, G1_GENERATOR_Y)
|
|
|
/// AFFINE_GENERATOR_COEFFS = (G1_GENERATOR_X, G1_GENERATOR_Y)
|
|
|
const AFFINE_GENERATOR_COEFFS: (Self::BaseField, Self::BaseField) =
|
|
|
const AFFINE_GENERATOR_COEFFS: (Self::BaseField, Self::BaseField) =
|
|
|
(G1_GENERATOR_X, G1_GENERATOR_Y);
|
|
|
(G1_GENERATOR_X, G1_GENERATOR_Y);
|
|
@ -106,14 +106,6 @@ impl TEModelParameters for Parameters { |
|
|
#[rustfmt::skip]
|
|
|
#[rustfmt::skip]
|
|
|
const COEFF_D: Fq = field_new!(Fq, "122268283598675559488486339158635529096981886914877139579534153582033676785385790730042363341236035746924960903179");
|
|
|
const COEFF_D: Fq = field_new!(Fq, "122268283598675559488486339158635529096981886914877139579534153582033676785385790730042363341236035746924960903179");
|
|
|
|
|
|
|
|
|
/// COFACTOR = (x - 1)^2 / 3 = 30631250834960419227450344600217059328
|
|
|
|
|
|
const COFACTOR: &'static [u64] = &[0x0, 0x170b5d4430000000];
|
|
|
|
|
|
|
|
|
|
|
|
/// COFACTOR_INV = COFACTOR^{-1} mod r
|
|
|
|
|
|
/// = 5285428838741532253824584287042945485047145357130994810877
|
|
|
|
|
|
#[rustfmt::skip]
|
|
|
|
|
|
const COFACTOR_INV: Fr = field_new!(Fr, "5285428838741532253824584287042945485047145357130994810877");
|
|
|
|
|
|
|
|
|
|
|
|
/// AFFINE_GENERATOR_COEFFS = (GENERATOR_X, GENERATOR_Y)
|
|
|
/// AFFINE_GENERATOR_COEFFS = (GENERATOR_X, GENERATOR_Y)
|
|
|
const AFFINE_GENERATOR_COEFFS: (Self::BaseField, Self::BaseField) =
|
|
|
const AFFINE_GENERATOR_COEFFS: (Self::BaseField, Self::BaseField) =
|
|
|
(TE_GENERATOR_X, TE_GENERATOR_Y);
|
|
|
(TE_GENERATOR_X, TE_GENERATOR_Y);
|
|
|