|
|
@ -1,5 +1,5 @@ |
|
|
|
use super::*;
|
|
|
|
use ark_ff::{biginteger::BigInteger384, field_new, fields::*};
|
|
|
|
use ark_ff::{field_new, fields::*};
|
|
|
|
|
|
|
|
pub type Fq6 = Fp6<Fq6Parameters>;
|
|
|
|
|
|
|
@ -11,166 +11,60 @@ impl Fp6Parameters for Fq6Parameters { |
|
|
|
|
|
|
|
/// NONRESIDUE = U
|
|
|
|
#[rustfmt::skip]
|
|
|
|
const NONRESIDUE: Fq2 = field_new!(Fq2,
|
|
|
|
field_new!(Fq, BigInteger384([0, 0, 0, 0, 0, 0])),
|
|
|
|
field_new!(Fq, BigInteger384([
|
|
|
|
202099033278250856u64,
|
|
|
|
5854854902718660529u64,
|
|
|
|
11492539364873682930u64,
|
|
|
|
8885205928937022213u64,
|
|
|
|
5545221690922665192u64,
|
|
|
|
39800542322357402u64,
|
|
|
|
])),
|
|
|
|
);
|
|
|
|
const NONRESIDUE: Fq2 = field_new!(Fq2, FQ_ZERO, FQ_ONE);
|
|
|
|
|
|
|
|
#[rustfmt::skip]
|
|
|
|
const FROBENIUS_COEFF_FP6_C1: &'static [Fq2] = &[
|
|
|
|
// Fp2::NONRESIDUE^(((q^0) - 1) / 3)
|
|
|
|
field_new!(Fq2,
|
|
|
|
field_new!(Fq, BigInteger384([
|
|
|
|
0x2cdffffffffff68,
|
|
|
|
0x51409f837fffffb1,
|
|
|
|
0x9f7db3a98a7d3ff2,
|
|
|
|
0x7b4e97b76e7c6305,
|
|
|
|
0x4cf495bf803c84e8,
|
|
|
|
0x8d6661e2fdf49a,
|
|
|
|
])),
|
|
|
|
field_new!(Fq, BigInteger384([0x0, 0x0, 0x0, 0x0, 0x0, 0x0])),
|
|
|
|
),
|
|
|
|
field_new!(Fq2, FQ_ONE, FQ_ZERO),
|
|
|
|
// Fp2::NONRESIDUE^(((q^1) - 1) / 3)
|
|
|
|
field_new!(Fq2,
|
|
|
|
field_new!(Fq, BigInteger384([
|
|
|
|
0x5892506da58478da,
|
|
|
|
0x133366940ac2a74b,
|
|
|
|
0x9b64a150cdf726cf,
|
|
|
|
0x5cc426090a9c587e,
|
|
|
|
0x5cf848adfdcd640c,
|
|
|
|
0x4702bf3ac02380,
|
|
|
|
])),
|
|
|
|
field_new!(Fq, BigInteger384([0x0, 0x0, 0x0, 0x0, 0x0, 0x0])),
|
|
|
|
field_new!(Fq, "80949648264912719408558363140637477264845294720710499478137287262712535938301461879813459410946"),
|
|
|
|
FQ_ZERO,
|
|
|
|
),
|
|
|
|
// Fp2::NONRESIDUE^(((q^2) - 1) / 3)
|
|
|
|
field_new!(Fq2,
|
|
|
|
field_new!(Fq, BigInteger384([
|
|
|
|
0xdacd106da5847973,
|
|
|
|
0xd8fe2454bac2a79a,
|
|
|
|
0x1ada4fd6fd832edc,
|
|
|
|
0xfb9868449d150908,
|
|
|
|
0xd63eb8aeea32285e,
|
|
|
|
0x167d6a36f873fd0,
|
|
|
|
])),
|
|
|
|
field_new!(Fq, BigInteger384([0x0, 0x0, 0x0, 0x0, 0x0, 0x0])),
|
|
|
|
field_new!(Fq, "80949648264912719408558363140637477264845294720710499478137287262712535938301461879813459410945"),
|
|
|
|
FQ_ZERO,
|
|
|
|
),
|
|
|
|
// Fp2::NONRESIDUE^(((q^3) - 1) / 3)
|
|
|
|
field_new!(Fq2,
|
|
|
|
field_new!(Fq, BigInteger384([
|
|
|
|
0x823ac00000000099,
|
|
|
|
0xc5cabdc0b000004f,
|
|
|
|
0x7f75ae862f8c080d,
|
|
|
|
0x9ed4423b9278b089,
|
|
|
|
0x79467000ec64c452,
|
|
|
|
0x120d3e434c71c50,
|
|
|
|
])),
|
|
|
|
field_new!(Fq, BigInteger384([0x0, 0x0, 0x0, 0x0, 0x0, 0x0])),
|
|
|
|
),
|
|
|
|
field_new!(Fq2, field_new!(Fq, "-1"), FQ_ZERO),
|
|
|
|
// Fp2::NONRESIDUE^(((q^4) - 1) / 3)
|
|
|
|
field_new!(Fq2,
|
|
|
|
field_new!(Fq, BigInteger384([
|
|
|
|
0x2c766f925a7b8727,
|
|
|
|
0x3d7f6b0253d58b5,
|
|
|
|
0x838ec0deec122131,
|
|
|
|
0xbd5eb3e9f658bb10,
|
|
|
|
0x6942bd126ed3e52e,
|
|
|
|
0x1673786dd04ed6a,
|
|
|
|
])),
|
|
|
|
field_new!(Fq, BigInteger384([0x0, 0x0, 0x0, 0x0, 0x0, 0x0])),
|
|
|
|
field_new!(Fq, "258664426012969093929703085429980814127835149614277183275038967946009968870203535512256352201271898244626862047231"),
|
|
|
|
FQ_ZERO,
|
|
|
|
),
|
|
|
|
// Fp2::NONRESIDUE^(((q^5) - 1) / 3)
|
|
|
|
field_new!(Fq2,
|
|
|
|
field_new!(Fq, BigInteger384([
|
|
|
|
0xaa3baf925a7b868e,
|
|
|
|
0x3e0d38ef753d5865,
|
|
|
|
0x4191258bc861923,
|
|
|
|
0x1e8a71ae63e00a87,
|
|
|
|
0xeffc4d11826f20dc,
|
|
|
|
0x4663a2a83dd119,
|
|
|
|
])),
|
|
|
|
field_new!(Fq, BigInteger384([0x0, 0x0, 0x0, 0x0, 0x0, 0x0])),
|
|
|
|
field_new!(Fq, "258664426012969093929703085429980814127835149614277183275038967946009968870203535512256352201271898244626862047232"),
|
|
|
|
FQ_ZERO,
|
|
|
|
),
|
|
|
|
];
|
|
|
|
#[rustfmt::skip]
|
|
|
|
const FROBENIUS_COEFF_FP6_C2: &'static [Fq2] = &[
|
|
|
|
// Fp2::NONRESIDUE^((2*(q^0) - 2) / 3)
|
|
|
|
field_new!(Fq2,
|
|
|
|
field_new!(Fq, BigInteger384([
|
|
|
|
0x2cdffffffffff68,
|
|
|
|
0x51409f837fffffb1,
|
|
|
|
0x9f7db3a98a7d3ff2,
|
|
|
|
0x7b4e97b76e7c6305,
|
|
|
|
0x4cf495bf803c84e8,
|
|
|
|
0x8d6661e2fdf49a,
|
|
|
|
])),
|
|
|
|
field_new!(Fq, BigInteger384([0x0, 0x0, 0x0, 0x0, 0x0, 0x0])),
|
|
|
|
),
|
|
|
|
field_new!(Fq2, FQ_ONE, FQ_ZERO),
|
|
|
|
// Fp2::NONRESIDUE^((2*(q^1) - 2) / 3)
|
|
|
|
field_new!(Fq2,
|
|
|
|
field_new!(Fq, BigInteger384([
|
|
|
|
0xdacd106da5847973,
|
|
|
|
0xd8fe2454bac2a79a,
|
|
|
|
0x1ada4fd6fd832edc,
|
|
|
|
0xfb9868449d150908,
|
|
|
|
0xd63eb8aeea32285e,
|
|
|
|
0x167d6a36f873fd0,
|
|
|
|
])),
|
|
|
|
field_new!(Fq, BigInteger384([0x0, 0x0, 0x0, 0x0, 0x0, 0x0])),
|
|
|
|
field_new!(Fq, "80949648264912719408558363140637477264845294720710499478137287262712535938301461879813459410945"),
|
|
|
|
FQ_ZERO
|
|
|
|
),
|
|
|
|
// Fp2::NONRESIDUE^((2*(q^2) - 2) / 3)
|
|
|
|
field_new!(Fq2,
|
|
|
|
field_new!(Fq, BigInteger384([
|
|
|
|
0x2c766f925a7b8727,
|
|
|
|
0x3d7f6b0253d58b5,
|
|
|
|
0x838ec0deec122131,
|
|
|
|
0xbd5eb3e9f658bb10,
|
|
|
|
0x6942bd126ed3e52e,
|
|
|
|
0x1673786dd04ed6a,
|
|
|
|
])),
|
|
|
|
field_new!(Fq, BigInteger384([0x0, 0x0, 0x0, 0x0, 0x0, 0x0])),
|
|
|
|
field_new!(Fq, "258664426012969093929703085429980814127835149614277183275038967946009968870203535512256352201271898244626862047231"),
|
|
|
|
FQ_ZERO,
|
|
|
|
),
|
|
|
|
// Fp2::NONRESIDUE^((2*(q^3) - 2) / 3)
|
|
|
|
field_new!(Fq2,
|
|
|
|
field_new!(Fq, BigInteger384([
|
|
|
|
0x2cdffffffffff68,
|
|
|
|
0x51409f837fffffb1,
|
|
|
|
0x9f7db3a98a7d3ff2,
|
|
|
|
0x7b4e97b76e7c6305,
|
|
|
|
0x4cf495bf803c84e8,
|
|
|
|
0x8d6661e2fdf49a,
|
|
|
|
])),
|
|
|
|
field_new!(Fq, BigInteger384([0x0, 0x0, 0x0, 0x0, 0x0, 0x0])),
|
|
|
|
),
|
|
|
|
field_new!(Fq2, FQ_ONE, FQ_ZERO),
|
|
|
|
// Fp2::NONRESIDUE^((2*(q^4) - 2) / 3)
|
|
|
|
field_new!(Fq2,
|
|
|
|
field_new!(Fq, BigInteger384([
|
|
|
|
0xdacd106da5847973,
|
|
|
|
0xd8fe2454bac2a79a,
|
|
|
|
0x1ada4fd6fd832edc,
|
|
|
|
0xfb9868449d150908,
|
|
|
|
0xd63eb8aeea32285e,
|
|
|
|
0x167d6a36f873fd0,
|
|
|
|
])),
|
|
|
|
field_new!(Fq, BigInteger384([0x0, 0x0, 0x0, 0x0, 0x0, 0x0])),
|
|
|
|
field_new!(Fq, "80949648264912719408558363140637477264845294720710499478137287262712535938301461879813459410945"),
|
|
|
|
FQ_ZERO,
|
|
|
|
),
|
|
|
|
// Fp2::NONRESIDUE^((2*(q^5) - 2) / 3)
|
|
|
|
field_new!(Fq2,
|
|
|
|
field_new!(Fq, BigInteger384([
|
|
|
|
0x2c766f925a7b8727,
|
|
|
|
0x3d7f6b0253d58b5,
|
|
|
|
0x838ec0deec122131,
|
|
|
|
0xbd5eb3e9f658bb10,
|
|
|
|
0x6942bd126ed3e52e,
|
|
|
|
0x1673786dd04ed6a,
|
|
|
|
])),
|
|
|
|
field_new!(Fq, BigInteger384([0x0, 0x0, 0x0, 0x0, 0x0, 0x0])),
|
|
|
|
field_new!(Fq, "258664426012969093929703085429980814127835149614277183275038967946009968870203535512256352201271898244626862047231"),
|
|
|
|
FQ_ZERO,
|
|
|
|
),
|
|
|
|
];
|
|
|
|
|
|
|
|