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/// A variable that is the R1CS equivalent of `algebra::bls12_377::Fq2`.
8pub type Fq2Var = Fp2Var<Fq2Parameters>;
9/// A variable that is the R1CS equivalent of `algebra::bls12_377::Fq6`.
10pub type Fq6Var = Fp6Var<Fq6Parameters>;
11/// A variable that is the R1CS equivalent of `algebra::bls12_377::Fq12`.
12pub type Fq12Var = Fp12Var<Fq12Parameters>;
13
14#[test]
15fn bls12_377_field_test() {
16 use super::*;
17 use crate::fields::tests::*;
18 use algebra::bls12_377::{Fq, Fq12, Fq2, Fq6};
19
20 field_test::<_, _, FqVar>().unwrap();
21 frobenius_tests::<Fq, _, FqVar>(13).unwrap();
22
23 field_test::<_, _, Fq2Var>().unwrap();
24 frobenius_tests::<Fq2, _, Fq2Var>(13).unwrap();
25
26 field_test::<_, _, Fq6Var>().unwrap();
27 frobenius_tests::<Fq6, _, Fq6Var>(13).unwrap();
28
29 field_test::<_, _, Fq12Var>().unwrap();
30 frobenius_tests::<Fq12, _, Fq12Var>(13).unwrap();
31}