Skip to content

Commit

Permalink
fp12_tower.c: remove duplicate code.
Browse files Browse the repository at this point in the history
  • Loading branch information
dot-asm committed Dec 8, 2020
1 parent 79951b4 commit 6d73744
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions src/fp12_tower.c
Original file line number Diff line number Diff line change
Expand Up @@ -530,21 +530,6 @@ static void sqr_fp12(vec384fp12 ret, const vec384fp12 a)
static void conjugate_fp12(vec384fp12 a)
{ neg_fp6(a[1], a[1]); }

static void inverse_fp2(vec384x ret, const vec384x a)
{
vec384 t0, t1;

/* 1/(a0^2 + a1^2) */
sqr_fp(t0, a[0]);
sqr_fp(t1, a[1]);
add_fp(t0, t0, t1);
reciprocal_fp(t1, t0);

mul_fp(ret[0], a[0], t1);
mul_fp(ret[1], a[1], t1);
neg_fp(ret[1], ret[1]);
}

static void inverse_fp6(vec384fp6 ret, const vec384fp6 a)
{
vec384x c0, c1, c2, t0, t1;
Expand Down Expand Up @@ -574,7 +559,7 @@ static void inverse_fp6(vec384fp6 ret, const vec384fp6 a)
mul_fp2(t1, c0, a[0]);
add_fp2(t0, t0, t1);

inverse_fp2(t1, t0);
reciprocal_fp2(t1, t0);

mul_fp2(ret[0], c0, t1);
mul_fp2(ret[1], c1, t1);
Expand Down

0 comments on commit 6d73744

Please sign in to comment.