arnaucube
arnaucube/ark-curves-cherry-pickedPublic Self-hosted repository
ark-curves-cherry-picked/bls12_377/src/fields/fq12.rs
bls12_377/src/fields/fq12.rsRaw
  1use super::*;
  2use ark_ff::{biginteger::BigInteger384, field_new, fields::*};
  3
  4pub type Fq12 = Fp12<Fq12Parameters>;
  5
  6#[derive(Clone, Copy)]
  7pub struct Fq12Parameters;
  8
  9impl Fp12Parameters for Fq12Parameters {
 10    type Fp6Params = Fq6Parameters;
 11
 12    const NONRESIDUE: Fq6 = field_new!(Fq6, FQ2_ZERO, FQ2_ONE, FQ2_ZERO);
 13
 14    #[rustfmt::skip]
 15    const FROBENIUS_COEFF_FP12_C1: &'static [Fq2] = &[
 16        // Fp2::NONRESIDUE^(((q^0) - 1) / 6)
 17        field_new!(Fq2,
 18            field_new!(Fq, BigInteger384([
 19                0x2cdffffffffff68,
 20                0x51409f837fffffb1,
 21                0x9f7db3a98a7d3ff2,
 22                0x7b4e97b76e7c6305,
 23                0x4cf495bf803c84e8,
 24                0x8d6661e2fdf49a,
 25            ])),
 26            FQ_ZERO,
 27        ),
 28        // Fp2::NONRESIDUE^(((q^1) - 1) / 6)
 29        field_new!(Fq2,
 30            field_new!(Fq, BigInteger384([
 31                0x6ec47a04a3f7ca9e,
 32                0xa42e0cb968c1fa44,
 33                0x578d5187fbd2bd23,
 34                0x930eeb0ac79dd4bd,
 35                0xa24883de1e09a9ee,
 36                0xdaa7058067d46f,
 37            ])),
 38            FQ_ZERO,
 39        ),
 40        // Fp2::NONRESIDUE^(((q^2) - 1) / 6)
 41        field_new!(Fq2,
 42            field_new!(Fq, BigInteger384([
 43                0x5892506da58478da,
 44                0x133366940ac2a74b,
 45                0x9b64a150cdf726cf,
 46                0x5cc426090a9c587e,
 47                0x5cf848adfdcd640c,
 48                0x4702bf3ac02380,
 49            ])),
 50            FQ_ZERO,
 51        ),
 52        // Fp2::NONRESIDUE^(((q^3) - 1) / 6)
 53        field_new!(Fq2,
 54            field_new!(Fq, BigInteger384([
 55                0x982c13d9d084771f,
 56                0xfd49de0c6da34a32,
 57                0x61a530d183ab0e53,
 58                0xdf8fe44106dd9879,
 59                0x40f29b58d88472bc,
 60                0x158723199046d5d,
 61            ])),
 62            FQ_ZERO,
 63        ),
 64        // Fp2::NONRESIDUE^(((q^4) - 1) / 6)
 65        field_new!(Fq2,
 66            field_new!(Fq, BigInteger384([
 67                0xdacd106da5847973,
 68                0xd8fe2454bac2a79a,
 69                0x1ada4fd6fd832edc,
 70                0xfb9868449d150908,
 71                0xd63eb8aeea32285e,
 72                0x167d6a36f873fd0,
 73            ])),
 74            FQ_ZERO,
 75        ),
 76        // Fp2::NONRESIDUE^(((q^5) - 1) / 6)
 77        field_new!(Fq2,
 78            field_new!(Fq, BigInteger384([
 79                0x296799d52c8cac81,
 80                0x591bd15304e14fee,
 81                0xa17df4987d85130,
 82                0x4c80f9363f3fc3bc,
 83                0x9eaa177aba7ac8ce,
 84                0x7dcb2c189c98ed,
 85            ])),
 86            FQ_ZERO,
 87        ),
 88        // Fp2::NONRESIDUE^(((q^6) - 1) / 6)
 89        field_new!(Fq2,
 90            field_new!(Fq, BigInteger384([
 91                0x823ac00000000099,
 92                0xc5cabdc0b000004f,
 93                0x7f75ae862f8c080d,
 94                0x9ed4423b9278b089,
 95                0x79467000ec64c452,
 96                0x120d3e434c71c50,
 97            ])),
 98            field_new!(Fq, BigInteger384([0x0, 0x0, 0x0, 0x0, 0x0, 0x0])),
 99        ),
100        // Fp2::NONRESIDUE^(((q^7) - 1) / 6)
101        field_new!(Fq2,
102            field_new!(Fq, BigInteger384([
103                0x164445fb5c083563,
104                0x72dd508ac73e05bc,
105                0xc76610a7be368adc,
106                0x8713eee839573ed1,
107                0x23f281e24e979f4c,
108                0xd39340975d3c7b,
109            ])),
110            FQ_ZERO,
111        ),
112        // Fp2::NONRESIDUE^(((q^8) - 1) / 6)
113        field_new!(Fq2,
114            field_new!(Fq, BigInteger384([
115                0x2c766f925a7b8727,
116                0x3d7f6b0253d58b5,
117                0x838ec0deec122131,
118                0xbd5eb3e9f658bb10,
119                0x6942bd126ed3e52e,
120                0x1673786dd04ed6a,
121            ])),
122            FQ_ZERO,
123        ),
124        // Fp2::NONRESIDUE^(((q^9) - 1) / 6)
125        field_new!(Fq2,
126            field_new!(Fq, BigInteger384([
127                0xecdcac262f7b88e2,
128                0x19c17f37c25cb5cd,
129                0xbd4e315e365e39ac,
130                0x3a92f5b1fa177b15,
131                0x85486a67941cd67e,
132                0x55c8147ec0a38d,
133            ])),
134            FQ_ZERO,
135        ),
136        // Fp2::NONRESIDUE^(((q^10) - 1) / 6)
137        field_new!(Fq2,
138            field_new!(Fq, BigInteger384([
139                0xaa3baf925a7b868e,
140                0x3e0d38ef753d5865,
141                0x4191258bc861923,
142                0x1e8a71ae63e00a87,
143                0xeffc4d11826f20dc,
144                0x4663a2a83dd119,
145            ])),
146            FQ_ZERO,
147        ),
148        // Fp2::NONRESIDUE^(((q^11) - 1) / 6)
149        field_new!(Fq2,
150            field_new!(Fq, BigInteger384([
151                0x5ba1262ad3735380,
152                0xbdef8bf12b1eb012,
153                0x14db82e63230f6cf,
154                0xcda1e0bcc1b54fd3,
155                0x2790ee45b226806c,
156                0x1306f19ff2877fd,
157            ])),
158            FQ_ZERO,
159        ),
160    ];
161}