mirror of
https://github.com/arnaucube/ark-curves-cherry-picked.git
synced 2026-01-27 14:13:46 +01:00
Catch up with algebra (#106)
Co-authored-by: Pratyush Mishra <pratyushmishra@berkeley.edu>
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
use ark_ec::{
|
||||
mnt6,
|
||||
models::{ModelParameters, SWModelParameters},
|
||||
models::{short_weierstrass::SWCurveConfig, CurveConfig},
|
||||
};
|
||||
use ark_ff::MontFp;
|
||||
use ark_ff::{Field, MontFp};
|
||||
|
||||
use crate::{Fq, Fr};
|
||||
|
||||
@@ -13,7 +13,7 @@ pub type G1Prepared = mnt6::G1Prepared<crate::Parameters>;
|
||||
#[derive(Clone, Default, PartialEq, Eq)]
|
||||
pub struct Parameters;
|
||||
|
||||
impl ModelParameters for Parameters {
|
||||
impl CurveConfig for Parameters {
|
||||
type BaseField = Fq;
|
||||
type ScalarField = Fr;
|
||||
|
||||
@@ -21,25 +21,24 @@ impl ModelParameters for Parameters {
|
||||
const COFACTOR: &'static [u64] = &[1];
|
||||
|
||||
/// COFACTOR^(-1) mod r = 1
|
||||
const COFACTOR_INV: Fr = MontFp!(Fr, "1");
|
||||
const COFACTOR_INV: Fr = Fr::ONE;
|
||||
}
|
||||
|
||||
impl SWModelParameters for Parameters {
|
||||
impl SWCurveConfig for Parameters {
|
||||
/// COEFF_A = 11
|
||||
const COEFF_A: Fq = MontFp!(Fq, "11");
|
||||
const COEFF_A: Fq = MontFp!("11");
|
||||
|
||||
/// COEFF_B = 106700080510851735677967319632585352256454251201367587890185989362936000262606668469523074
|
||||
const COEFF_B: Fq = MontFp!(Fq, "106700080510851735677967319632585352256454251201367587890185989362936000262606668469523074");
|
||||
const COEFF_B: Fq = MontFp!("106700080510851735677967319632585352256454251201367587890185989362936000262606668469523074");
|
||||
|
||||
/// AFFINE_GENERATOR_COEFFS = (G1_GENERATOR_X, G1_GENERATOR_Y)
|
||||
const AFFINE_GENERATOR_COEFFS: (Self::BaseField, Self::BaseField) =
|
||||
(G1_GENERATOR_X, G1_GENERATOR_Y);
|
||||
const GENERATOR: G1Affine = G1Affine::new_unchecked(G1_GENERATOR_X, G1_GENERATOR_Y);
|
||||
}
|
||||
|
||||
/// G1_GENERATOR_X =
|
||||
#[rustfmt::skip]
|
||||
pub const G1_GENERATOR_X: Fq = MontFp!(Fq, "336685752883082228109289846353937104185698209371404178342968838739115829740084426881123453");
|
||||
pub const G1_GENERATOR_X: Fq = MontFp!("336685752883082228109289846353937104185698209371404178342968838739115829740084426881123453");
|
||||
|
||||
/// G1_GENERATOR_Y =
|
||||
#[rustfmt::skip]
|
||||
pub const G1_GENERATOR_Y: Fq = MontFp!(Fq, "402596290139780989709332707716568920777622032073762749862342374583908837063963736098549800");
|
||||
pub const G1_GENERATOR_Y: Fq = MontFp!("402596290139780989709332707716568920777622032073762749862342374583908837063963736098549800");
|
||||
|
||||
Reference in New Issue
Block a user