Update MNT4-298

This commit is contained in:
Pratyush Mishra
2020-12-09 00:12:57 -08:00
parent 4b050b1aae
commit 6f7235d939
6 changed files with 29 additions and 151 deletions

View File

@@ -1,6 +1,5 @@
use crate::{Fq, FQ_ONE};
use ark_ff::{
biginteger::BigInteger320 as BigInteger,
field_new,
fields::fp2::{Fp2, Fp2Parameters},
};
@@ -15,28 +14,13 @@ impl Fp2Parameters for Fq2Parameters {
/// The quadratic non-residue (17) used to construct the extension is
/// the same as that used in [`libff`](https://github.com/scipr-lab/libff/blob/c927821ebe02e0a24b5e0f9170cec5e211a35f08/libff/algebra/curves/mnt/mnt4/mnt4_init.cpp#L102).
#[rustfmt::skip]
const NONRESIDUE: Fq = field_new!(Fq, BigInteger([
2709730703260633621,
13556085429182073539,
10903316137158576359,
5319113788683590444,
4022235209932,
]));
const NONRESIDUE: Fq = field_new!(Fq, "17");
/// The quadratic non-residue in F<sub>p</sub><sup>2</sup> that is used
/// in the computation of square roots is (8, 1), the same as that in
/// [`libff`](https://github.com/scipr-lab/libff/blob/c927821ebe02e0a24b5e0f9170cec5e211a35f08/libff/algebra/curves/mnt/mnt4/mnt4_init.cpp#L103)
const QUADRATIC_NONRESIDUE: (Self::Fp, Self::Fp) = (
field_new!(
Fq,
BigInteger([
7706310747053761245,
9941175645274129776,
14857322459377157960,
7030003475866554129,
3101682770110
])
),
field_new!(Fq, "8"),
FQ_ONE,
);
@@ -44,15 +28,6 @@ impl Fp2Parameters for Fq2Parameters {
/// `[1, 475922286169261325753349249653048451545124879242694725395555128576210262817955800483758080]`
const FROBENIUS_COEFF_FP2_C1: &'static [Self::Fp] = &[
FQ_ONE,
field_new!(
Fq,
BigInteger([
12702890790846888869,
6326265861366186013,
364584707886187945,
8740893163049517815,
2181130330288
])
),
field_new!(Fq, "475922286169261325753349249653048451545124879242694725395555128576210262817955800483758080"),
];
}

View File

@@ -1,6 +1,5 @@
use crate::{Fq, Fq2, Fq2Parameters, FQ_ONE, FQ_ZERO};
use ark_ff::{
biginteger::BigInteger320 as BigInteger,
field_new,
fields::fp4::{Fp4, Fp4Parameters},
};
@@ -22,35 +21,8 @@ impl Fp4Parameters for Fq4Parameters {
#[rustfmt::skip]
const FROBENIUS_COEFF_FP4_C1: &'static [Fq] = &[
FQ_ONE,
field_new!(
Fq,
BigInteger([
16439849825752526567,
14772594681319164557,
16175669228740845684,
4590896976404796446,
3810243174413
])
),
field_new!(
Fq,
BigInteger([
12702890790846888869,
6326265861366186013,
364584707886187945,
8740893163049517815,
2181130330288
])
),
field_new!(
Fq,
BigInteger([
16494084033238978842,
8405712270147289988,
16893921313687769205,
7111183964905832559,
299901908070
])
),
field_new!(Fq, "7684163245453501615621351552473337069301082060976805004625011694147890954040864167002308"),
field_new!(Fq, "475922286169261325753349249653048451545124879242694725395555128576210262817955800483758080"),
field_new!(Fq, "468238122923807824137727898100575114475823797181717920390930116882062371863914936316755773"),
];
}