Implementations
sourceimpl<'chip, F: PrimeField> Fp12Chip<'chip, F>
impl<'chip, F: PrimeField> Fp12Chip<'chip, F>
pub fn frobenius_map(
&self,
ctx: &mut Context<F>,
a: &<Self as FieldChip<F>>::FieldPoint,
power: usize
) -> <Self as FieldChip<F>>::FieldPoint
sourcepub fn pow(
&self,
ctx: &mut Context<F>,
a: &<Self as FieldChip<F>>::FieldPoint,
exp: Vec<u64>
) -> <Self as FieldChip<F>>::FieldPoint
pub fn pow(
&self,
ctx: &mut Context<F>,
a: &<Self as FieldChip<F>>::FieldPoint,
exp: Vec<u64>
) -> <Self as FieldChip<F>>::FieldPoint
Assumptions
a
is nonzero field point
sourcepub fn cyclotomic_compress(&self, a: &FqPoint<F>) -> Vec<FqPoint<F>>
pub fn cyclotomic_compress(&self, a: &FqPoint<F>) -> Vec<FqPoint<F>>
in = g0 + g2 w + g4 w^2 + g1 w^3 + g3 w^4 + g5 w^5 where g_i = g_i0 + g_i1 * u are elements of Fp2 out = Compress(in) = [ g2, g3, g4, g5 ]
sourcepub fn cyclotomic_decompress(
&self,
ctx: &mut Context<F>,
compression: Vec<FqPoint<F>>
) -> FqPoint<F>
pub fn cyclotomic_decompress(
&self,
ctx: &mut Context<F>,
compression: Vec<FqPoint<F>>
) -> FqPoint<F>
Input:
compression = [g2, g3, g4, g5]
where g_i are proper elements of Fp2 Output:Decompress(compression) = g0 + g2 w + g4 w^2 + g1 w^3 + g3 w^4 + g5 w^5
where- All elements of output are proper elements of Fp2 and: c = XI0 + u if g2 != 0: g1 = (g5^2 * c + 3 g4^2 - 2 g3)/(4g2) g0 = (2 g1^2 + g2 * g5 - 3 g3*g4) * c + 1 if g2 = 0: g1 = (2 g4 * g5)/g3 g0 = (2 g1^2 - 3 g3 * g4) * c + 1
pub fn cyclotomic_square(
&self,
ctx: &mut Context<F>,
compression: &[FqPoint<F>]
) -> Vec<FqPoint<F>>
sourcepub fn cyclotomic_pow(
&self,
ctx: &mut Context<F>,
a: FqPoint<F>,
exp: Vec<u64>
) -> FqPoint<F>
pub fn cyclotomic_pow(
&self,
ctx: &mut Context<F>,
a: FqPoint<F>,
exp: Vec<u64>
) -> FqPoint<F>
Assumptions
a
is a nonzero element in the cyclotomic subgroup
pub fn hard_part_BN(
&self,
ctx: &mut Context<F>,
m: <Self as FieldChip<F>>::FieldPoint
) -> <Self as FieldChip<F>>::FieldPoint
sourcepub fn easy_part(
&self,
ctx: &mut Context<F>,
a: <Self as FieldChip<F>>::FieldPoint
) -> <Self as FieldChip<F>>::FieldPoint
pub fn easy_part(
&self,
ctx: &mut Context<F>,
a: <Self as FieldChip<F>>::FieldPoint
) -> <Self as FieldChip<F>>::FieldPoint
Assumptions
a
is nonzero field point