Document r1cs-std

This commit is contained in:
Pratyush Mishra
2020-09-10 01:16:01 -07:00
parent c21d0b2796
commit 370fbcdd3b
61 changed files with 691 additions and 211 deletions

View File

@@ -1,10 +1,16 @@
use crate::groups::mnt4;
use algebra::mnt4_298::Parameters;
/// An element of G1 in the MNT4-298 bilinear group.
pub type G1Var = mnt4::G1Var<Parameters>;
/// An element of G2 in the MNT4-298 bilinear group.
pub type G2Var = mnt4::G2Var<Parameters>;
/// Represents the cached precomputation that can be performed on a G1 element
/// which enables speeding up pairing computation.
pub type G1PreparedVar = mnt4::G1PreparedVar<Parameters>;
/// Represents the cached precomputation that can be performed on a G2 element
/// which enables speeding up pairing computation.
pub type G2PreparedVar = mnt4::G2PreparedVar<Parameters>;
#[test]

View File

@@ -2,8 +2,11 @@ use algebra::mnt4_298::{Fq, Fq2Parameters, Fq4Parameters};
use crate::fields::{fp::FpVar, fp2::Fp2Var, fp4::Fp4Var};
/// A variable that is the R1CS equivalent of `algebra::mnt4_298::Fq`.
pub type FqVar = FpVar<Fq>;
/// A variable that is the R1CS equivalent of `algebra::mnt4_298::Fq2`.
pub type Fq2Var = Fp2Var<Fq2Parameters>;
/// A variable that is the R1CS equivalent of `algebra::mnt4_298::Fq4`.
pub type Fq4Var = Fp4Var<Fq4Parameters>;
#[test]

View File

@@ -1,5 +1,6 @@
use algebra::mnt4_298::Parameters;
/// Specifies the constraints for computing a pairing in the MNT4-298 bilinear group.
pub type PairingVar = crate::pairing::mnt4::PairingVar<Parameters>;
#[test]