mirror of
https://github.com/arnaucube/ark-curves-cherry-picked.git
synced 2026-01-09 07:21:30 +01:00
new add + mul by residue + 1
This commit is contained in:
@@ -44,6 +44,15 @@ impl Fp2Parameters for Fq2Parameters {
|
|||||||
*x - c
|
*x - c
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// x + y + (-5 * y), computed as x - 4*y
|
||||||
|
#[inline(always)]
|
||||||
|
fn add_and_mul_fp_by_nonresidue_plus_one(x: &Self::Fp, y: &Self::Fp) -> Self::Fp {
|
||||||
|
// c becomes 4 * y
|
||||||
|
let mut c = y.double();
|
||||||
|
c.double_in_place();
|
||||||
|
*x - c
|
||||||
|
}
|
||||||
|
|
||||||
// x - (-5 * y), computed as x + 5*y
|
// x - (-5 * y), computed as x + 5*y
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn sub_and_mul_fp_by_nonresidue(x: &Self::Fp, y: &Self::Fp) -> Self::Fp {
|
fn sub_and_mul_fp_by_nonresidue(x: &Self::Fp, y: &Self::Fp) -> Self::Fp {
|
||||||
|
|||||||
Reference in New Issue
Block a user