Invert buggy logic in secp256k1_ecdsa_seckey_verify

This commit is contained in:
Pieter Wuille 2013-07-13 01:31:41 +02:00
parent 634bc1820c
commit b0be6aba91
1 changed files with 2 additions and 2 deletions

View File

@ -115,8 +115,8 @@ int secp256k1_ecdsa_seckey_verify(const unsigned char *seckey) {
secp256k1_num_t sec; secp256k1_num_t sec;
secp256k1_num_init(&sec); secp256k1_num_init(&sec);
secp256k1_num_set_bin(&sec, seckey, 32); secp256k1_num_set_bin(&sec, seckey, 32);
int ret = secp256k1_num_is_zero(&sec) || int ret = !secp256k1_num_is_zero(&sec) &&
(secp256k1_num_cmp(&sec, &secp256k1_ge_consts->order) >= 0); (secp256k1_num_cmp(&sec, &secp256k1_ge_consts->order) < 0);
secp256k1_num_free(&sec); secp256k1_num_free(&sec);
return ret; return ret;
} }