mirror of
https://github.com/arnaucube/ark-curves-cherry-picked.git
synced 2026-01-27 14:13:46 +01:00
Update BLS12-381
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use crate::*;
|
||||
use ark_ff::{biginteger::BigInteger384 as BigInteger, field_new, fields::*};
|
||||
use ark_ff::{field_new, fields::*};
|
||||
|
||||
pub type Fq2 = Fp2<Fq2Parameters>;
|
||||
|
||||
@@ -10,57 +10,19 @@ impl Fp2Parameters for Fq2Parameters {
|
||||
|
||||
/// NONRESIDUE = -1
|
||||
#[rustfmt::skip]
|
||||
const NONRESIDUE: Fq = field_new!(Fq, BigInteger([
|
||||
0x43f5fffffffcaaae,
|
||||
0x32b7fff2ed47fffd,
|
||||
0x7e83a49a2e99d69,
|
||||
0xeca8f3318332bb7a,
|
||||
0xef148d1ea0f4c069,
|
||||
0x40ab3263eff0206,
|
||||
]));
|
||||
const NONRESIDUE: Fq = field_new!(Fq, "-1");
|
||||
|
||||
/// QUADRATIC_NONRESIDUE = (U + 1)
|
||||
#[rustfmt::skip]
|
||||
const QUADRATIC_NONRESIDUE: (Fq, Fq) = (
|
||||
field_new!(Fq, BigInteger([
|
||||
0x760900000002fffd,
|
||||
0xebf4000bc40c0002,
|
||||
0x5f48985753c758ba,
|
||||
0x77ce585370525745,
|
||||
0x5c071a97a256ec6d,
|
||||
0x15f65ec3fa80e493,
|
||||
])),
|
||||
field_new!(Fq, BigInteger([
|
||||
0x760900000002fffd,
|
||||
0xebf4000bc40c0002,
|
||||
0x5f48985753c758ba,
|
||||
0x77ce585370525745,
|
||||
0x5c071a97a256ec6d,
|
||||
0x15f65ec3fa80e493,
|
||||
])),
|
||||
);
|
||||
const QUADRATIC_NONRESIDUE: (Fq, Fq) = (FQ_ONE, FQ_ONE);
|
||||
|
||||
/// Coefficients for the Frobenius automorphism.
|
||||
#[rustfmt::skip]
|
||||
const FROBENIUS_COEFF_FP2_C1: &'static [Fq] = &[
|
||||
// Fq(-1)**(((q^0) - 1) / 2)
|
||||
field_new!(Fq, BigInteger([
|
||||
0x760900000002fffd,
|
||||
0xebf4000bc40c0002,
|
||||
0x5f48985753c758ba,
|
||||
0x77ce585370525745,
|
||||
0x5c071a97a256ec6d,
|
||||
0x15f65ec3fa80e493,
|
||||
])),
|
||||
field_new!(Fq, "1"),
|
||||
// Fq(-1)**(((q^1) - 1) / 2)
|
||||
field_new!(Fq, BigInteger([
|
||||
0x43f5fffffffcaaae,
|
||||
0x32b7fff2ed47fffd,
|
||||
0x7e83a49a2e99d69,
|
||||
0xeca8f3318332bb7a,
|
||||
0xef148d1ea0f4c069,
|
||||
0x40ab3263eff0206,
|
||||
])),
|
||||
field_new!(Fq, "-1"),
|
||||
];
|
||||
|
||||
#[inline(always)]
|
||||
|
||||
Reference in New Issue
Block a user