arnaucube
arnaucube/ark-curves-cherry-pickedPublic Self-hosted repository
ark-curves-cherry-picked/mnt6_753/src/curves/g1.rs
mnt6_753/src/curves/g1.rsRaw
  1use ark_ec::{
  2    mnt6,
  3    models::{ModelParameters, SWModelParameters},
  4};
  5use ark_ff::{biginteger::BigInteger768, field_new};
  6
  7use crate::{Fq, Fr, FR_ONE};
  8
  9pub type G1Affine = mnt6::G1Affine<crate::Parameters>;
 10pub type G1Projective = mnt6::G1Projective<crate::Parameters>;
 11pub type G1Prepared = mnt6::G1Prepared<crate::Parameters>;
 12
 13#[derive(Clone, Default, PartialEq, Eq)]
 14pub struct Parameters;
 15
 16impl ModelParameters for Parameters {
 17    type BaseField = Fq;
 18    type ScalarField = Fr;
 19}
 20
 21impl SWModelParameters for Parameters {
 22    /// COEFF_A = 11
 23    #[rustfmt::skip]
 24    const COEFF_A: Fq = field_new!(Fq, BigInteger768([
 25        5145524327033718740,
 26        14149824967095184544,
 27        5159730833497260295,
 28        3902941467692815387,
 29        15830098551216085679,
 30        8665641533746801158,
 31        17502192300007146323,
 32        14483698255198590748,
 33        546300946688995976,
 34        4331975528992054828,
 35        5311428878520309260,
 36        495362057711802,
 37    ]));
 38
 39    /// COEFF_B = 0x7DA285E70863C79D56446237CE2E1468D14AE9BB64B2BB01B10E60A5D5DFE0A25714B7985993F62F03B22A9A3C737A1A1E0FCF2C43D7BF847957C34CCA1E3585F9A80A95F401867C4E80F4747FDE5ABA7505BA6FCF2485540B13DFC8468A
 40    #[rustfmt::skip]
 41    const COEFF_B: Fq = field_new!(Fq, BigInteger768([
 42        8828711393625909642,
 43        12722539140758597443,
 44        2303826860244282256,
 45        8063890988281098391,
 46        6269149169423748670,
 47        3425772737529456013,
 48        1457017085322601211,
 49        5177155908178255133,
 50        18057960053344868113,
 51        10481469207136524576,
 52        17888199912367160320,
 53        290288558853910,
 54    ]));
 55
 56    /// COFACTOR = 1
 57    const COFACTOR: &'static [u64] = &[1];
 58
 59    /// COFACTOR^(-1) mod r =
 60    /// 1
 61    #[rustfmt::skip]
 62    const COFACTOR_INV: Fr = FR_ONE;
 63
 64    /// AFFINE_GENERATOR_COEFFS = (G1_GENERATOR_X, G1_GENERATOR_Y)
 65    const AFFINE_GENERATOR_COEFFS: (Self::BaseField, Self::BaseField) =
 66        (G1_GENERATOR_X, G1_GENERATOR_Y);
 67}
 68
 69// Generator of G1
 70// X = 3458420969484235708806261200128850544017070333833944116801482064540723268149235477762870414664917360605949659630933184751526227993647030875167687492714052872195770088225183259051403087906158701786758441889742618916006546636728,
 71// Y = 27460508402331965149626600224382137254502975979168371111640924721589127725376473514838234361114855175488242007431439074223827742813911899817930728112297763448010814764117701403540298764970469500339646563344680868495474127850569,
 72/// G1_GENERATOR_X =
 73#[rustfmt::skip]
 74pub const G1_GENERATOR_X: Fq = field_new!(Fq, BigInteger768([
 75    16404456614462158210,
 76    16873534995404346316,
 77    29580875041164893,
 78    12740551787746921884,
 79    16087583716780115490,
 80    15096170813200936110,
 81    930080103225705610,
 82    660122182606823185,
 83    5211213138865083410,
 84    15466479635231681544,
 85    11783401481713071326,
 86    20214808394592
 87]));
 88
 89/// G1_GENERATOR_Y =
 90#[rustfmt::skip]
 91pub const G1_GENERATOR_Y: Fq = field_new!(Fq, BigInteger768([
 92    11636140615878154554,
 93    15149343852908177063,
 94    14426639389651280896,
 95    12711360703798958610,
 96    3787948290527586979,
 97    7628180411662927078,
 98    17195203689728925717,
 99    6800476327444280291,
100    2228796880865780105,
101    15627033749683396124,
102    13783535191786892346,
103    61400438920476
104]));