arnaucube
arnaucube/ark-curves-cherry-pickedPublic Self-hosted repository
ark-curves-cherry-picked/mnt4_753/src/fields/fq4.rs
mnt4_753/src/fields/fq4.rsRaw
 1use crate::{Fq, Fq2, Fq2Parameters, FQ_ONE, FQ_ZERO};
 2use ark_ff::{
 3    biginteger::BigInteger768 as BigInteger,
 4    field_new,
 5    fields::fp4::{Fp4, Fp4Parameters},
 6};
 7
 8pub type Fq4 = Fp4<Fq4Parameters>;
 9
10pub struct Fq4Parameters;
11
12impl Fp4Parameters for Fq4Parameters {
13    type Fp2Params = Fq2Parameters;
14
15    const NONRESIDUE: Fq2 = field_new!(Fq2, FQ_ZERO, FQ_ONE);
16
17    // Coefficients for the Frobenius automorphism.
18    // c1[0] = 1,
19    // c1[1] = 18691656569803771296244054523431852464958959799019013859007259692542121208304602539555350517075508287829753932558576476751900235650227380562700444433662761577027341858128610410779088384480737679672900770810745291515010467307990
20    // c1[2] = 41898490967918953402344214791240637128170709919953949071783502921025352812571106773058893763790338921418070971888253786114353726529584385201591605722013126468931404347949840543007986327743462853720628051692141265303114721689600
21    // c1[3] = 23206834398115182106100160267808784663211750120934935212776243228483231604266504233503543246714830633588317039329677309362453490879357004638891167538350364891904062489821230132228897943262725174047727280881395973788104254381611
22    #[rustfmt::skip]
23    const FROBENIUS_COEFF_FP4_C1: &'static [Fq] = &[
24        FQ_ONE,
25        field_new!(Fq, BigInteger([
26            2732208433323581659,
27            2172983777736624684,
28            14351170316343013496,
29            6345300643186282385,
30            3197292113538174065,
31            1887663496013421009,
32            16627860175048929982,
33            1842296636815120666,
34            13463717484107308085,
35            721000253033730237,
36            1214767992212094798,
37            163570781165682,
38         ])),
39        field_new!(Fq, BigInteger([
40            14260497802974073023,
41            5895249896161266456,
42            14682908860938702530,
43            17222385991615618722,
44            14621060510943733448,
45            10594887362868996148,
46            7477357615964975684,
47            12570239403004322603,
48            2180620924574446161,
49            12129628062772479841,
50            8853285699251153944,
51            362282887012814,
52        ])),
53        field_new!(Fq, BigInteger([
54            4081847608632041254,
55            14228374352133326707,
56            11267574244067947896,
57            1174247187748832530,
58            10065542319823237575,
59            10873259071217986508,
60            12902564573729719519,
61            17180267336735511666,
62            11808206507871910973,
63            12535793096497356591,
64            18394626215023595103,
65            334259642706846,
66        ])),
67    ];
68}