Skip to content

Commit

Permalink
Fix general case when p = 3 mod 4 and FP_QNRES=off.
Browse files Browse the repository at this point in the history
  • Loading branch information
dfaranha committed Apr 24, 2024
1 parent b02e550 commit bf8c7a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/fpx/relic_fpx_field.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ void fp2_field_init(void) {
ctx->qnr2 = 0;
fp_zero(t0[0]);
fp_set_dig(t0[1], 1);
/* If it does not work, attempt (u + 2), otherwise double. */
/* If it does not work, attempt (u + 1), otherwise double. */
/* We cannot used QR test here due to Frobenius constants below. */
if (fp2_srt(t1, t0)) {
ctx->qnr2 = 2;
ctx->qnr2 = 1;
fp_set_dig(t0[0], ctx->qnr2);
while (fp2_srt(t1, t0) && util_bits_dig(ctx->qnr2) < RLC_DIG - 1) {
/* Pick a power of 2 for efficiency. */
Expand Down

0 comments on commit bf8c7a3

Please sign in to comment.