Signed-off-by: Dmitry Eremin-Solenikov <[email protected]>
---
 testsuite/ecdsa-keygen-test.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/testsuite/ecdsa-keygen-test.c b/testsuite/ecdsa-keygen-test.c
index a96c09effeef..e728094c1ab4 100644
--- a/testsuite/ecdsa-keygen-test.c
+++ b/testsuite/ecdsa-keygen-test.c
@@ -44,7 +44,10 @@ ecc_valid_p (struct ecc_point *pub)
     {
       /* Check y^2 = x^3 - 3 x + b */
       mpz_mul (rhs, x, x);
-      mpz_sub_ui (rhs, rhs, 3);
+      if (pub->ecc->a > 0)
+       mpz_add_ui (rhs, rhs, pub->ecc->a);
+      else
+       mpz_sub_ui (rhs, rhs, -pub->ecc->a);
       mpz_mul (rhs, rhs, x);
       mpz_add (rhs, rhs, mpz_roinit_n (t, pub->ecc->b, size));
     }
-- 
2.14.2

_______________________________________________
nettle-bugs mailing list
[email protected]
http://lists.lysator.liu.se/mailman/listinfo/nettle-bugs

Reply via email to