Skip to content

Commit

Permalink
Support fields where -3 is QNR.
Browse files Browse the repository at this point in the history
  • Loading branch information
dfaranha committed Apr 23, 2024
1 parent cfe0e15 commit 7b849c1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ep/relic_ep_curve.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ static void ep_curve_set_map(void) {

/* If curve is not supersingular, precompute and store sqrt(-3)
* neeed for hashing using the SwiftEC algorithm and variants. */
if (!ep_curve_is_super()) {
if (!ep_curve_is_super() && (ep_curve_opt_a() == RLC_ZERO || ep_curve_opt_b() == RLC_ZERO)) {
fp_set_dig(c4, 3);
fp_neg(c4, c4);
if (!fp_srt(c4, c4)) {
Expand Down Expand Up @@ -574,4 +574,5 @@ int ep_curve_frdim(void) {
return 16;
break;
}
}
return 0;
}

0 comments on commit 7b849c1

Please sign in to comment.