ark-r1cs-std/r1cs-std/src/instantiated/bls12_377/fields.rs
r1cs-std/src/instantiated/bls12_377/fields.rsRaw
1use algebra::bls12_377::{Fq, Fq12Parameters, Fq2Parameters, Fq6Parameters};
2
3use crate::fields::{fp::FpVar, fp12::Fp12Var, fp2::Fp2Var, fp6_3over2::Fp6Var};
4
5/// A variable that is the R1CS equivalent of `algebra::bls12_377::Fq`.
6pub type FqVar = FpVar<Fq>;
7
8/// A variable that is the R1CS equivalent of `algebra::bls12_377::Fq2`.
9pub type Fq2Var = Fp2Var<Fq2Parameters>;
10/// A variable that is the R1CS equivalent of `algebra::bls12_377::Fq6`.
11pub type Fq6Var = Fp6Var<Fq6Parameters>;
12/// A variable that is the R1CS equivalent of `algebra::bls12_377::Fq12`.
13pub type Fq12Var = Fp12Var<Fq12Parameters>;
14
15#[test]
16fn bls12_377_field_test() {
17 use super::*;
18 use crate::fields::tests::*;
19 use algebra::bls12_377::{Fq, Fq12, Fq2, Fq6};
20
21 field_test::<_, _, FqVar>().unwrap();
22 frobenius_tests::<Fq, _, FqVar>(13).unwrap();
23
24 field_test::<_, _, Fq2Var>().unwrap();
25 frobenius_tests::<Fq2, _, Fq2Var>(13).unwrap();
26
27 field_test::<_, _, Fq6Var>().unwrap();
28 frobenius_tests::<Fq6, _, Fq6Var>(13).unwrap();
29
30 field_test::<_, _, Fq12Var>().unwrap();
31 frobenius_tests::<Fq12, _, Fq12Var>(13).unwrap();
32}