arnaucube
arnaucube/ark-curves-cherry-pickedPublic Self-hosted repository
ark-curves-cherry-picked/mnt4_753/src/constraints/fields.rs
mnt4_753/src/constraints/fields.rsRaw
 1use ark_r1cs_std::fields::{fp::FpVar, fp2::Fp2Var, fp4::Fp4Var};
 2
 3use crate::{Fq, Fq2Config, Fq4Config};
 4
 5/// A variable that is the R1CS equivalent of `crate::Fq`.
 6pub type FqVar = FpVar<Fq>;
 7/// A variable that is the R1CS equivalent of `crate::Fq2`.
 8pub type Fq2Var = Fp2Var<Fq2Config>;
 9/// A variable that is the R1CS equivalent of `crate::Fq4`.
10pub type Fq4Var = Fp4Var<Fq4Config>;
11
12#[test]
13fn mnt4_753_field_gadgets_test() {
14    use super::*;
15    use crate::{Fq, Fq2, Fq4};
16    use ark_curve_constraint_tests::fields::*;
17
18    field_test::<_, _, FqVar>().unwrap();
19    frobenius_tests::<Fq, _, FqVar>(13).unwrap();
20
21    field_test::<_, _, Fq2Var>().unwrap();
22    frobenius_tests::<Fq2, _, Fq2Var>(13).unwrap();
23
24    field_test::<_, _, Fq4Var>().unwrap();
25    frobenius_tests::<Fq4, _, Fq4Var>(13).unwrap();
26}