arnaucube
arnaucube/ark-curves-cherry-pickedPublic Self-hosted repository
ark-curves-cherry-picked/mnt6_298/src/fields/fq3.rs
mnt6_298/src/fields/fq3.rsRaw
  1use crate::fq::Fq;
  2use ark_ff::{
  3    biginteger::BigInteger320 as BigInteger,
  4    field_new,
  5    fields::fp3::{Fp3, Fp3Parameters},
  6};
  7
  8pub type Fq3 = Fp3<Fq3Parameters>;
  9
 10pub struct Fq3Parameters;
 11
 12impl Fp3Parameters for Fq3Parameters {
 13    type Fp = Fq;
 14
 15    #[rustfmt::skip]
 16    const NONRESIDUE: Fq = field_new!(Fq, BigInteger([
 17        0x58eefd67fea995ca,
 18        0x12f14affbb33a004,
 19        0x4780323da44ac69b,
 20        0x88acf9bea707eed9,
 21        0x14bbbb859e8,
 22    ]));
 23
 24    const TWO_ADICITY: u32 = 34;
 25
 26    #[rustfmt::skip]
 27    const T_MINUS_ONE_DIV_TWO: &'static [u64] = &[
 28        0x69232b75663933bd,
 29        0xca650efcfc00ee0,
 30        0x77ca3963fe36f720,
 31        0xe4cb46632f9bcf7e,
 32        0xef510453f08f9f30,
 33        0x9dd5b8fc72f02d83,
 34        0x7f8d017ed86608ab,
 35        0xeb2219b3697c97a4,
 36        0xc8663846ab96996f,
 37        0x833cd532053eac7d,
 38        0x1d5b73dfb20bd3cc,
 39        0x6f5f6da606b59873,
 40        0x62e990f43dfc42d6,
 41        0x6878f58,
 42    ];
 43
 44    #[rustfmt::skip]
 45    const QUADRATIC_NONRESIDUE_TO_T: (Fq, Fq, Fq) = (
 46        field_new!(Fq, BigInteger([
 47            0x44a4178610a3a4e6,
 48            0x49321e4d00f35073,
 49            0xbbc01b9c400c07a1,
 50            0xd0127c4589095738,
 51            0x3730de2a45d,
 52        ])),
 53        field_new!(Fq, BigInteger([0, 0, 0, 0, 0])),
 54        field_new!(Fq, BigInteger([0, 0, 0, 0, 0])),
 55    );
 56
 57    #[rustfmt::skip]
 58    const FROBENIUS_COEFF_FP3_C1: &'static [Fq] = &[
 59        field_new!(Fq, BigInteger([
 60            0xc3177aefffbb845c,
 61            0x9b80c702f9961788,
 62            0xc5df8dcdac70a85a,
 63            0x29184098647b5197,
 64            0x1c1223d33c3,
 65        ])),
 66        field_new!(Fq, BigInteger([
 67            0x1c17bb7477085b6a,
 68            0x2621629c22e83dbb,
 69            0x21c062106d949dd8,
 70            0x9d5b981062164ba,
 71            0x84ad703207,
 72        ])),
 73        field_new!(Fq, BigInteger([
 74            0xdc13fe3f893c203b,
 75            0x39a7226875df158f,
 76            0xe34ed98542eefb62,
 77            0x6f782a843d139e3c,
 78            0x177280f6ea9,
 79        ])),
 80    ];
 81
 82    #[rustfmt::skip]
 83    const FROBENIUS_COEFF_FP3_C2: &'static [Fq] = &[
 84        field_new!(Fq, BigInteger([
 85            0xc3177aefffbb845c,
 86            0x9b80c702f9961788,
 87            0xc5df8dcdac70a85a,
 88            0x29184098647b5197,
 89            0x1c1223d33c3,
 90        ])),
 91        field_new!(Fq, BigInteger([
 92            0xdc13fe3f893c203b,
 93            0x39a7226875df158f,
 94            0xe34ed98542eefb62,
 95            0x6f782a843d139e3c,
 96            0x177280f6ea9,
 97        ])),
 98        field_new!(Fq, BigInteger([
 99            0x1c17bb7477085b6a,
100            0x2621629c22e83dbb,
101            0x21c062106d949dd8,
102            0x9d5b981062164ba,
103            0x84ad703207,
104        ])),
105    ];
106}