From b02b648c4d9255f3e6e14c7b3436bf399fb769b9 Mon Sep 17 00:00:00 2001 From: toddouska Date: Fri, 29 Aug 2014 18:09:18 -0700 Subject: [PATCH] fix mp_val non prime issue --- ctaocrypt/src/ecc.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ctaocrypt/src/ecc.c b/ctaocrypt/src/ecc.c index bc6836f8a..742baf8f2 100644 --- a/ctaocrypt/src/ecc.c +++ b/ctaocrypt/src/ecc.c @@ -4660,14 +4660,12 @@ int mp_sqrtmod_prime(mp_int* n, mp_int* prime, mp_int* ret) done = 1; } - /* NOW: TonelliShanks algorithm */ if (res == MP_OKAY && done == 0) { /* factor out powers of 2 from prime-1, defining Q and S * as: prime-1 = Q*2^S */ - res = mp_copy(prime, &Q); if (res == MP_OKAY) res = mp_sub_d(&Q, 1, &Q); @@ -4716,8 +4714,6 @@ int mp_sqrtmod_prime(mp_int* n, mp_int* prime, mp_int* ret) if (res == MP_OKAY) res = mp_set_int(&two, 2); - if (res == MP_OKAY) - res = MP_VAL; while (res == MP_OKAY && done == 0) { res = mp_copy(&T, &t1); i = 0;