|
@ -1,5 +1,5 @@ |
|
|
use crate::*;
|
|
|
use crate::*;
|
|
|
use ark_ff::{biginteger::BigInteger384, field_new, fields::*};
|
|
|
|
|
|
|
|
|
use ark_ff::{field_new, fields::*};
|
|
|
|
|
|
|
|
|
pub type Fq6 = Fp6<Fq6Parameters>;
|
|
|
pub type Fq6 = Fp6<Fq6Parameters>;
|
|
|
|
|
|
|
|
@ -12,173 +12,75 @@ impl Fp6Parameters for Fq6Parameters { |
|
|
/// NONRESIDUE = (U + 1)
|
|
|
/// NONRESIDUE = (U + 1)
|
|
|
#[rustfmt::skip]
|
|
|
#[rustfmt::skip]
|
|
|
const NONRESIDUE: Fq2 = field_new!(Fq2,
|
|
|
const NONRESIDUE: Fq2 = field_new!(Fq2,
|
|
|
field_new!(Fq, BigInteger384([
|
|
|
|
|
|
0x760900000002fffd,
|
|
|
|
|
|
0xebf4000bc40c0002,
|
|
|
|
|
|
0x5f48985753c758ba,
|
|
|
|
|
|
0x77ce585370525745,
|
|
|
|
|
|
0x5c071a97a256ec6d,
|
|
|
|
|
|
0x15f65ec3fa80e493,
|
|
|
|
|
|
])),
|
|
|
|
|
|
field_new!(Fq, BigInteger384([
|
|
|
|
|
|
0x760900000002fffd,
|
|
|
|
|
|
0xebf4000bc40c0002,
|
|
|
|
|
|
0x5f48985753c758ba,
|
|
|
|
|
|
0x77ce585370525745,
|
|
|
|
|
|
0x5c071a97a256ec6d,
|
|
|
|
|
|
0x15f65ec3fa80e493,
|
|
|
|
|
|
])),
|
|
|
|
|
|
|
|
|
field_new!(Fq, "1"),
|
|
|
|
|
|
field_new!(Fq, "1"),
|
|
|
);
|
|
|
);
|
|
|
|
|
|
|
|
|
#[rustfmt::skip]
|
|
|
#[rustfmt::skip]
|
|
|
const FROBENIUS_COEFF_FP6_C1: &'static [Fq2] = &[
|
|
|
const FROBENIUS_COEFF_FP6_C1: &'static [Fq2] = &[
|
|
|
// Fq2(u + 1)**(((q^0) - 1) / 3)
|
|
|
|
|
|
field_new!(Fq2,
|
|
|
|
|
|
field_new!(Fq, BigInteger384([
|
|
|
|
|
|
0x760900000002fffd,
|
|
|
|
|
|
0xebf4000bc40c0002,
|
|
|
|
|
|
0x5f48985753c758ba,
|
|
|
|
|
|
0x77ce585370525745,
|
|
|
|
|
|
0x5c071a97a256ec6d,
|
|
|
|
|
|
0x15f65ec3fa80e493,
|
|
|
|
|
|
])),
|
|
|
|
|
|
field_new!(Fq, BigInteger384([0x0, 0x0, 0x0, 0x0, 0x0, 0x0])),
|
|
|
|
|
|
|
|
|
// Fp2::NONRESIDUE^(((q^0) - 1) / 3)
|
|
|
|
|
|
field_new!(Fq2,
|
|
|
|
|
|
field_new!(Fq, "1"),
|
|
|
|
|
|
field_new!(Fq, "0"),
|
|
|
),
|
|
|
),
|
|
|
// Fq2(u + 1)**(((q^1) - 1) / 3)
|
|
|
|
|
|
field_new!(Fq2,
|
|
|
|
|
|
field_new!(Fq, BigInteger384([0x0, 0x0, 0x0, 0x0, 0x0, 0x0])),
|
|
|
|
|
|
field_new!(Fq, BigInteger384([
|
|
|
|
|
|
0xcd03c9e48671f071,
|
|
|
|
|
|
0x5dab22461fcda5d2,
|
|
|
|
|
|
0x587042afd3851b95,
|
|
|
|
|
|
0x8eb60ebe01bacb9e,
|
|
|
|
|
|
0x3f97d6e83d050d2,
|
|
|
|
|
|
0x18f0206554638741,
|
|
|
|
|
|
])),
|
|
|
|
|
|
|
|
|
// Fp2::NONRESIDUE^(((q^1) - 1) / 3)
|
|
|
|
|
|
field_new!(Fq2,
|
|
|
|
|
|
field_new!(Fq, "0"),
|
|
|
|
|
|
field_new!(Fq, "4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939436"),
|
|
|
),
|
|
|
),
|
|
|
// Fq2(u + 1)**(((q^2) - 1) / 3)
|
|
|
|
|
|
field_new!(Fq2,
|
|
|
|
|
|
field_new!(Fq, BigInteger384([
|
|
|
|
|
|
0x30f1361b798a64e8,
|
|
|
|
|
|
0xf3b8ddab7ece5a2a,
|
|
|
|
|
|
0x16a8ca3ac61577f7,
|
|
|
|
|
|
0xc26a2ff874fd029b,
|
|
|
|
|
|
0x3636b76660701c6e,
|
|
|
|
|
|
0x51ba4ab241b6160,
|
|
|
|
|
|
])),
|
|
|
|
|
|
field_new!(Fq, BigInteger384([0x0, 0x0, 0x0, 0x0, 0x0, 0x0])),
|
|
|
|
|
|
|
|
|
// Fp2::NONRESIDUE^(((q^2) - 1) / 3)
|
|
|
|
|
|
field_new!(Fq2,
|
|
|
|
|
|
field_new!(Fq, "793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620350"),
|
|
|
|
|
|
field_new!(Fq, "0"),
|
|
|
),
|
|
|
),
|
|
|
// Fq2(u + 1)**(((q^3) - 1) / 3)
|
|
|
|
|
|
field_new!(Fq2,
|
|
|
|
|
|
field_new!(Fq, BigInteger384([0x0, 0x0, 0x0, 0x0, 0x0, 0x0])),
|
|
|
|
|
|
field_new!(Fq, BigInteger384([
|
|
|
|
|
|
0x760900000002fffd,
|
|
|
|
|
|
0xebf4000bc40c0002,
|
|
|
|
|
|
0x5f48985753c758ba,
|
|
|
|
|
|
0x77ce585370525745,
|
|
|
|
|
|
0x5c071a97a256ec6d,
|
|
|
|
|
|
0x15f65ec3fa80e493,
|
|
|
|
|
|
])),
|
|
|
|
|
|
|
|
|
// Fp2::NONRESIDUE^(((q^3) - 1) / 3)
|
|
|
|
|
|
field_new!(Fq2,
|
|
|
|
|
|
field_new!(Fq, "0"),
|
|
|
|
|
|
field_new!(Fq, "1"),
|
|
|
),
|
|
|
),
|
|
|
// Fq2(u + 1)**(((q^4) - 1) / 3)
|
|
|
|
|
|
field_new!(Fq2,
|
|
|
|
|
|
field_new!(Fq, BigInteger384([
|
|
|
|
|
|
0xcd03c9e48671f071,
|
|
|
|
|
|
0x5dab22461fcda5d2,
|
|
|
|
|
|
0x587042afd3851b95,
|
|
|
|
|
|
0x8eb60ebe01bacb9e,
|
|
|
|
|
|
0x3f97d6e83d050d2,
|
|
|
|
|
|
0x18f0206554638741,
|
|
|
|
|
|
])),
|
|
|
|
|
|
field_new!(Fq, BigInteger384([0x0, 0x0, 0x0, 0x0, 0x0, 0x0])),
|
|
|
|
|
|
|
|
|
// Fp2::NONRESIDUE^(((q^4) - 1) / 3)
|
|
|
|
|
|
field_new!(Fq2,
|
|
|
|
|
|
field_new!(Fq, "4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939436"),
|
|
|
|
|
|
field_new!(Fq, "0"),
|
|
|
),
|
|
|
),
|
|
|
// Fq2(u + 1)**(((q^5) - 1) / 3)
|
|
|
|
|
|
field_new!(Fq2,
|
|
|
|
|
|
field_new!(Fq, BigInteger384([0x0, 0x0, 0x0, 0x0, 0x0, 0x0])),
|
|
|
|
|
|
field_new!(Fq, BigInteger384([
|
|
|
|
|
|
0x30f1361b798a64e8,
|
|
|
|
|
|
0xf3b8ddab7ece5a2a,
|
|
|
|
|
|
0x16a8ca3ac61577f7,
|
|
|
|
|
|
0xc26a2ff874fd029b,
|
|
|
|
|
|
0x3636b76660701c6e,
|
|
|
|
|
|
0x51ba4ab241b6160,
|
|
|
|
|
|
])),
|
|
|
|
|
|
|
|
|
// Fp2::NONRESIDUE^(((q^5) - 1) / 3)
|
|
|
|
|
|
field_new!(Fq2,
|
|
|
|
|
|
field_new!(Fq, "0"),
|
|
|
|
|
|
field_new!(Fq, "793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620350"),
|
|
|
),
|
|
|
),
|
|
|
];
|
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
#[rustfmt::skip]
|
|
|
#[rustfmt::skip]
|
|
|
const FROBENIUS_COEFF_FP6_C2: &'static [Fq2] = &[
|
|
|
const FROBENIUS_COEFF_FP6_C2: &'static [Fq2] = &[
|
|
|
// Fq2(u + 1)**(((2q^0) - 2) / 3)
|
|
|
// Fq2(u + 1)**(((2q^0) - 2) / 3)
|
|
|
field_new!(Fq2,
|
|
|
field_new!(Fq2,
|
|
|
field_new!(Fq, BigInteger384([
|
|
|
|
|
|
0x760900000002fffd,
|
|
|
|
|
|
0xebf4000bc40c0002,
|
|
|
|
|
|
0x5f48985753c758ba,
|
|
|
|
|
|
0x77ce585370525745,
|
|
|
|
|
|
0x5c071a97a256ec6d,
|
|
|
|
|
|
0x15f65ec3fa80e493,
|
|
|
|
|
|
])),
|
|
|
|
|
|
field_new!(Fq, BigInteger384([0x0, 0x0, 0x0, 0x0, 0x0, 0x0])),
|
|
|
|
|
|
|
|
|
field_new!(Fq, "1"),
|
|
|
|
|
|
field_new!(Fq, "0"),
|
|
|
),
|
|
|
),
|
|
|
// Fq2(u + 1)**(((2q^1) - 2) / 3)
|
|
|
// Fq2(u + 1)**(((2q^1) - 2) / 3)
|
|
|
field_new!(Fq2,
|
|
|
field_new!(Fq2,
|
|
|
field_new!(Fq, BigInteger384([
|
|
|
|
|
|
0x890dc9e4867545c3,
|
|
|
|
|
|
0x2af322533285a5d5,
|
|
|
|
|
|
0x50880866309b7e2c,
|
|
|
|
|
|
0xa20d1b8c7e881024,
|
|
|
|
|
|
0x14e4f04fe2db9068,
|
|
|
|
|
|
0x14e56d3f1564853a,
|
|
|
|
|
|
])),
|
|
|
|
|
|
field_new!(Fq, BigInteger384([0x0, 0x0, 0x0, 0x0, 0x0, 0x0])),
|
|
|
|
|
|
|
|
|
field_new!(Fq, "4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939437"),
|
|
|
|
|
|
field_new!(Fq, "0"),
|
|
|
),
|
|
|
),
|
|
|
// Fq2(u + 1)**(((2q^2) - 2) / 3)
|
|
|
// Fq2(u + 1)**(((2q^2) - 2) / 3)
|
|
|
field_new!(Fq2,
|
|
|
field_new!(Fq2,
|
|
|
field_new!(Fq, BigInteger384([
|
|
|
|
|
|
0xcd03c9e48671f071,
|
|
|
|
|
|
0x5dab22461fcda5d2,
|
|
|
|
|
|
0x587042afd3851b95,
|
|
|
|
|
|
0x8eb60ebe01bacb9e,
|
|
|
|
|
|
0x3f97d6e83d050d2,
|
|
|
|
|
|
0x18f0206554638741,
|
|
|
|
|
|
])),
|
|
|
|
|
|
field_new!(Fq, BigInteger384([0x0, 0x0, 0x0, 0x0, 0x0, 0x0])),
|
|
|
|
|
|
|
|
|
field_new!(Fq, "4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939436"),
|
|
|
|
|
|
field_new!(Fq, "0"),
|
|
|
),
|
|
|
),
|
|
|
// Fq2(u + 1)**(((2q^3) - 2) / 3)
|
|
|
// Fq2(u + 1)**(((2q^3) - 2) / 3)
|
|
|
field_new!(Fq2,
|
|
|
field_new!(Fq2,
|
|
|
field_new!(Fq, BigInteger384([
|
|
|
|
|
|
0x43f5fffffffcaaae,
|
|
|
|
|
|
0x32b7fff2ed47fffd,
|
|
|
|
|
|
0x7e83a49a2e99d69,
|
|
|
|
|
|
0xeca8f3318332bb7a,
|
|
|
|
|
|
0xef148d1ea0f4c069,
|
|
|
|
|
|
0x40ab3263eff0206,
|
|
|
|
|
|
])),
|
|
|
|
|
|
field_new!(Fq, BigInteger384([0x0, 0x0, 0x0, 0x0, 0x0, 0x0])),
|
|
|
|
|
|
|
|
|
field_new!(Fq, "-1"),
|
|
|
|
|
|
field_new!(Fq, "0"),
|
|
|
),
|
|
|
),
|
|
|
// Fq2(u + 1)**(((2q^4) - 2) / 3)
|
|
|
// Fq2(u + 1)**(((2q^4) - 2) / 3)
|
|
|
field_new!(Fq2,
|
|
|
field_new!(Fq2,
|
|
|
field_new!(Fq, BigInteger384([
|
|
|
|
|
|
0x30f1361b798a64e8,
|
|
|
|
|
|
0xf3b8ddab7ece5a2a,
|
|
|
|
|
|
0x16a8ca3ac61577f7,
|
|
|
|
|
|
0xc26a2ff874fd029b,
|
|
|
|
|
|
0x3636b76660701c6e,
|
|
|
|
|
|
0x51ba4ab241b6160,
|
|
|
|
|
|
])),
|
|
|
|
|
|
field_new!(Fq, BigInteger384([0x0, 0x0, 0x0, 0x0, 0x0, 0x0])),
|
|
|
|
|
|
|
|
|
field_new!(Fq, "793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620350"),
|
|
|
|
|
|
field_new!(Fq, "0"),
|
|
|
),
|
|
|
),
|
|
|
// Fq2(u + 1)**(((2q^5) - 2) / 3)
|
|
|
// Fq2(u + 1)**(((2q^5) - 2) / 3)
|
|
|
field_new!(Fq2,
|
|
|
field_new!(Fq2,
|
|
|
field_new!(Fq, BigInteger384([
|
|
|
|
|
|
0xecfb361b798dba3a,
|
|
|
|
|
|
0xc100ddb891865a2c,
|
|
|
|
|
|
0xec08ff1232bda8e,
|
|
|
|
|
|
0xd5c13cc6f1ca4721,
|
|
|
|
|
|
0x47222a47bf7b5c04,
|
|
|
|
|
|
0x110f184e51c5f59,
|
|
|
|
|
|
])),
|
|
|
|
|
|
field_new!(Fq, BigInteger384([0x0, 0x0, 0x0, 0x0, 0x0, 0x0])),
|
|
|
|
|
|
|
|
|
field_new!(Fq, "793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620351"),
|
|
|
|
|
|
field_new!(Fq, "0"),
|
|
|
),
|
|
|
),
|
|
|
];
|
|
|
];
|
|
|
|
|
|
|
|
|