mirror of
https://github.com/arnaucube/ark-r1cs-std.git
synced 2026-01-12 00:41:32 +01:00
Update to arkworks libraries (#3)
Co-authored-by: Nicholas Ward <npward@berkeley.edu>
This commit is contained in:
17
src/fields/fp3.rs
Normal file
17
src/fields/fp3.rs
Normal file
@@ -0,0 +1,17 @@
|
||||
use crate::fields::{cubic_extension::*, fp::FpVar};
|
||||
use ark_ff::fields::{CubicExtParameters, Fp3Parameters, Fp3ParamsWrapper};
|
||||
|
||||
/// A cubic extension field constructed over a prime field.
|
||||
/// This is the R1CS equivalent of `ark_ff::Fp3<P>`.
|
||||
pub type Fp3Var<P> = CubicExtVar<FpVar<<P as Fp3Parameters>::Fp>, Fp3ParamsWrapper<P>>;
|
||||
|
||||
impl<P: Fp3Parameters> CubicExtVarParams<FpVar<P::Fp>> for Fp3ParamsWrapper<P> {
|
||||
fn mul_base_field_vars_by_frob_coeff(
|
||||
c1: &mut FpVar<P::Fp>,
|
||||
c2: &mut FpVar<P::Fp>,
|
||||
power: usize,
|
||||
) {
|
||||
*c1 *= Self::FROBENIUS_COEFF_C1[power % Self::DEGREE_OVER_BASE_PRIME_FIELD];
|
||||
*c2 *= Self::FROBENIUS_COEFF_C2[power % Self::DEGREE_OVER_BASE_PRIME_FIELD];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user