ark_r1cs_std/fields/
fp6_2over3.rs

1use crate::fields::{fp3::Fp3Var, quadratic_extension::*};
2use ark_ff::{fields::fp6_2over3::*, QuadExtConfig};
3
4/// A sextic extension field constructed as the tower of a
5/// quadratic extension over a cubic extension field.
6/// This is the R1CS equivalent of `ark_ff::fp6_2over3::Fp6<P>`.
7pub type Fp6Var<P> = QuadExtVar<Fp3Var<<P as Fp6Config>::Fp3Config>, Fp6ConfigWrapper<P>>;
8
9impl<P: Fp6Config> QuadExtVarConfig<Fp3Var<P::Fp3Config>> for Fp6ConfigWrapper<P> {
10    fn mul_base_field_var_by_frob_coeff(fe: &mut Fp3Var<P::Fp3Config>, power: usize) {
11        fe.c0 *= Self::FROBENIUS_COEFF_C1[power % Self::DEGREE_OVER_BASE_PRIME_FIELD];
12        fe.c1 *= Self::FROBENIUS_COEFF_C1[power % Self::DEGREE_OVER_BASE_PRIME_FIELD];
13        fe.c2 *= Self::FROBENIUS_COEFF_C1[power % Self::DEGREE_OVER_BASE_PRIME_FIELD];
14    }
15}