Skip to content

Commit

Permalink
Improve support to FM18 curves.
Browse files Browse the repository at this point in the history
  • Loading branch information
dfaranha committed Nov 23, 2023
1 parent 18a12ec commit 18d1396
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/epx/relic_ep3_mul.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,18 @@ static void ep3_psi(ep3_t r, const ep3_t p) {
ep3_sub(r, r, q);
break;
case EP_K18:
/* For KSS18, we have that u = p^4 - 3*p mod r. */
/* For KSS18, we have that u = (p^4 - 3*p) mod r. */
ep3_dbl(q, p);
ep3_add(q, q, p);
ep3_frb(r, p, 3);
ep3_sub(r, r, q);
ep3_frb(r, r, 1);
break;
case EP_FM18:
ep3_frb(r, p, 1);
/* For FM18, we have that -u = (p-p^4) mod r. */
ep3_frb(q, p, 3);
ep3_sub(r, p, q);
ep3_frb(r, r, 1);
break;
}
}
Expand Down

0 comments on commit 18d1396

Please sign in to comment.