fix NIST P-256 / secp256k1 key generation.

This commit is contained in:
NIIBE Yutaka 2016-10-21 15:30:07 +09:00
parent e4333c6580
commit d4469c24ec
2 changed files with 5 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2016-10-21 Niibe Yutaka <gniibe@fsij.org>
* src/ecc.c (check_secret): Fix condition.
2016-10-15 NIIBE Yutaka <gniibe@fsij.org>
* VERSION: 1.2.2.

View File

@ -384,7 +384,7 @@ FUNC(check_secret) (const bn256 *d0, bn256 *d1)
{
ac Q0[1], Q1[1];
if (bn256_is_zero (d0) || bn256_sub (d1, N, d0) <= 0)
if (bn256_is_zero (d0) || bn256_sub (d1, N, d0) != 0)
/* == 0 or >= N, it's not valid. */
return 0;