Update MNT6-298

This commit is contained in:
Pratyush Mishra
2020-12-09 10:47:25 -08:00
parent 6f7235d939
commit 1534bbbfdf
6 changed files with 49 additions and 242 deletions

View File

@@ -1,6 +1,5 @@
use crate::fq::Fq;
use crate::{fq::Fq, FQ_ZERO};
use ark_ff::{
biginteger::BigInteger320 as BigInteger,
field_new,
fields::fp3::{Fp3, Fp3Parameters},
};
@@ -13,13 +12,7 @@ impl Fp3Parameters for Fq3Parameters {
type Fp = Fq;
#[rustfmt::skip]
const NONRESIDUE: Fq = field_new!(Fq, BigInteger([
0x58eefd67fea995ca,
0x12f14affbb33a004,
0x4780323da44ac69b,
0x88acf9bea707eed9,
0x14bbbb859e8,
]));
const NONRESIDUE: Fq = field_new!(Fq, "5");
const TWO_ADICITY: u32 = 34;
@@ -43,64 +36,22 @@ impl Fp3Parameters for Fq3Parameters {
#[rustfmt::skip]
const QUADRATIC_NONRESIDUE_TO_T: (Fq, Fq, Fq) = (
field_new!(Fq, BigInteger([
0x44a4178610a3a4e6,
0x49321e4d00f35073,
0xbbc01b9c400c07a1,
0xd0127c4589095738,
0x3730de2a45d,
])),
field_new!(Fq, BigInteger([0, 0, 0, 0, 0])),
field_new!(Fq, BigInteger([0, 0, 0, 0, 0])),
field_new!(Fq, "154361449678783505076984156275977937654331103361174469632346230549735979552469642799720052"),
FQ_ZERO,
FQ_ZERO,
);
#[rustfmt::skip]
const FROBENIUS_COEFF_FP3_C1: &'static [Fq] = &[
field_new!(Fq, BigInteger([
0xc3177aefffbb845c,
0x9b80c702f9961788,
0xc5df8dcdac70a85a,
0x29184098647b5197,
0x1c1223d33c3,
])),
field_new!(Fq, BigInteger([
0x1c17bb7477085b6a,
0x2621629c22e83dbb,
0x21c062106d949dd8,
0x9d5b981062164ba,
0x84ad703207,
])),
field_new!(Fq, BigInteger([
0xdc13fe3f893c203b,
0x39a7226875df158f,
0xe34ed98542eefb62,
0x6f782a843d139e3c,
0x177280f6ea9,
])),
field_new!(Fq, "1"),
field_new!(Fq, "471738898967521029133040851318449165997304108729558973770077319830005517129946578866686956"),
field_new!(Fq, "4183387201740296620308398334599285547820769823264541783190415909159130177461911693276180"),
];
#[rustfmt::skip]
const FROBENIUS_COEFF_FP3_C2: &'static [Fq] = &[
field_new!(Fq, BigInteger([
0xc3177aefffbb845c,
0x9b80c702f9961788,
0xc5df8dcdac70a85a,
0x29184098647b5197,
0x1c1223d33c3,
])),
field_new!(Fq, BigInteger([
0xdc13fe3f893c203b,
0x39a7226875df158f,
0xe34ed98542eefb62,
0x6f782a843d139e3c,
0x177280f6ea9,
])),
field_new!(Fq, BigInteger([
0x1c17bb7477085b6a,
0x2621629c22e83dbb,
0x21c062106d949dd8,
0x9d5b981062164ba,
0x84ad703207,
])),
Self::FROBENIUS_COEFF_FP3_C1[0],
Self::FROBENIUS_COEFF_FP3_C1[2],
Self::FROBENIUS_COEFF_FP3_C1[1],
];
}

View File

@@ -1,6 +1,5 @@
use crate::{Fq, Fq3, Fq3Parameters, FQ_ONE, FQ_ZERO};
use ark_ff::{
biginteger::BigInteger320 as BigInteger,
field_new,
fields::fp6_2over3::{Fp6, Fp6Parameters},
};
@@ -12,52 +11,14 @@ pub struct Fq6Parameters;
impl Fp6Parameters for Fq6Parameters {
type Fp3Params = Fq3Parameters;
#[rustfmt::skip]
const NONRESIDUE: Fq3 = field_new!(Fq3, FQ_ZERO, FQ_ONE, FQ_ZERO);
#[rustfmt::skip]
const FROBENIUS_COEFF_FP6_C1: &'static [Fq] = &[
field_new!(Fq, BigInteger([
0xc3177aefffbb845c,
0x9b80c702f9961788,
0xc5df8dcdac70a85a,
0x29184098647b5197,
0x1c1223d33c3,
])),
field_new!(Fq, BigInteger([
0xdf2f366476c3dfc6,
0xc1a2299f1c7e5543,
0xe79fefde1a054632,
0x32edfa196a9cb651,
0x245cfad65ca,
])),
field_new!(Fq, BigInteger([
0x1c17bb7477085b6a,
0x2621629c22e83dbb,
0x21c062106d949dd8,
0x9d5b981062164ba,
0x84ad703207,
])),
field_new!(Fq, BigInteger([
0xf82bb9b400447ba5,
0x5fc8850498c7534a,
0x50f3b95b083993a,
0x794de405433502f7,
0x1fbd57fa0b0,
])),
field_new!(Fq, BigInteger([
0xdc13fe3f893c203b,
0x39a7226875df158f,
0xe34ed98542eefb62,
0x6f782a843d139e3c,
0x177280f6ea9,
])),
field_new!(Fq, BigInteger([
0x9f2b792f88f7a497,
0xd527e96b6f752d18,
0xa92e6752ef5fa3bc,
0x98906b1ca18eefd4,
0x3384a4ca26c,
])),
field_new!(Fq, "1"),
field_new!(Fq, "471738898967521029133040851318449165997304108729558973770077319830005517129946578866686957"),
field_new!(Fq, "471738898967521029133040851318449165997304108729558973770077319830005517129946578866686956"),
field_new!(Fq, "475922286169261325753349249653048451545124878552823515553267735739164647307408490559963136"),
field_new!(Fq, "4183387201740296620308398334599285547820769823264541783190415909159130177461911693276180"),
field_new!(Fq, "4183387201740296620308398334599285547820769823264541783190415909159130177461911693276181"),
];
}