Update MNT4-753

This commit is contained in:
Pratyush Mishra
2020-12-09 00:00:30 -08:00
parent 5f62fab169
commit 4b050b1aae
6 changed files with 30 additions and 264 deletions

View File

@@ -2,7 +2,7 @@ use ark_ec::{
mnt4,
models::{ModelParameters, SWModelParameters},
};
use ark_ff::{biginteger::BigInteger768, field_new};
use ark_ff::field_new;
use crate::{Fq, Fr, FR_ONE};
@@ -21,37 +21,11 @@ impl ModelParameters for Parameters {
impl SWModelParameters for Parameters {
/// COEFF_A = 2
#[rustfmt::skip]
const COEFF_A: Fq = field_new!(Fq, BigInteger768([
3553860551672651396,
2565472393707818253,
3424927325234966109,
17487811826058095619,
15730291918544907998,
4332070408724822737,
7212646118208244402,
12904649141092619460,
9289117987390442562,
2254330573517213976,
3065472942259520298,
271095073719429,
]));
const COEFF_A: Fq = field_new!(Fq, "2");
/// COEFF_B = 0x01373684A8C9DCAE7A016AC5D7748D3313CD8E39051C596560835DF0C9E50A5B59B882A92C78DC537E51A16703EC9855C77FC3D8BB21C8D68BB8CFB9DB4B8C8FBA773111C36C8B1B4E8F1ECE940EF9EAAD265458E06372009C9A0491678EF4
#[rustfmt::skip]
const COEFF_B: Fq = field_new!(Fq, BigInteger768([
2672638521926201442,
17587766986973859626,
1309143029066506763,
1756412671449422902,
5395165286423163724,
589638022240022974,
7360845090332416697,
9829497896347590557,
9341553552113883496,
5888515763059971584,
10173739464651404689,
456607542322059,
]));
const COEFF_B: Fq = field_new!(Fq, "28798803903456388891410036793299405764940372360099938340752576406393880372126970068421383312482853541572780087363938442377933706865252053507077543420534380486492786626556269083255657125025963825610840222568694137138741554679540");
/// COFACTOR = 1
const COFACTOR: &'static [u64] = &[1];
@@ -69,36 +43,10 @@ impl SWModelParameters for Parameters {
// Generator of G1
// X = 7790163481385331313124631546957228376128961350185262705123068027727518350362064426002432450801002268747950550964579198552865939244360469674540925037890082678099826733417900510086646711680891516503232107232083181010099241949569,
// Y = 6913648190367314284606685101150155872986263667483624713540251048208073654617802840433842931301128643140890502238233930290161632176167186761333725658542781350626799660920481723757654531036893265359076440986158843531053720994648,
/// G1_GENERATOR_X =
/// G1_GENERATOR_X = 7790163481385331313124631546957228376128961350185262705123068027727518350362064426002432450801002268747950550964579198552865939244360469674540925037890082678099826733417900510086646711680891516503232107232083181010099241949569
#[rustfmt::skip]
pub const G1_GENERATOR_X: Fq = field_new!(Fq, BigInteger768([
9433494781491502420,
373642694095780604,
7974079134466535382,
15325904219470166885,
16825705122208020751,
898733863352481713,
3802318585082797759,
14417069684372068941,
4332882897981414838,
15138727514183191816,
16850594895992448907,
30598511593902
]));
pub const G1_GENERATOR_X: Fq = field_new!(Fq, "7790163481385331313124631546957228376128961350185262705123068027727518350362064426002432450801002268747950550964579198552865939244360469674540925037890082678099826733417900510086646711680891516503232107232083181010099241949569");
/// G1_GENERATOR_Y =
/// G1_GENERATOR_Y = 6913648190367314284606685101150155872986263667483624713540251048208073654617802840433842931301128643140890502238233930290161632176167186761333725658542781350626799660920481723757654531036893265359076440986158843531053720994648
#[rustfmt::skip]
pub const G1_GENERATOR_Y: Fq = field_new!(Fq, BigInteger768([
15710199097794077134,
3645667958306606136,
8298269426007169475,
5277073422205725562,
10451808582969862130,
14392820246664025579,
4365987620174557815,
14007263953321073101,
1355600847400958219,
3872959105252355444,
18016882244107198324,
424779036457857
]));
pub const G1_GENERATOR_Y: Fq = field_new!(Fq, "6913648190367314284606685101150155872986263667483624713540251048208073654617802840433842931301128643140890502238233930290161632176167186761333725658542781350626799660920481723757654531036893265359076440986158843531053720994648");