BN_zero -> BN_set_word
authorCryptoManiac <CryptoManiac@users.noreply.github.com>
Thu, 2 Dec 2021 17:32:36 +0000 (20:32 +0300)
committerGitHub <noreply@github.com>
Thu, 2 Dec 2021 17:32:36 +0000 (20:32 +0300)
src/key.cpp

index 0aaa948..94a54ef 100644 (file)
@@ -102,7 +102,7 @@ int ECDSA_SIG_recover_key_GFp(EC_KEY *eckey, ECDSA_SIG *ecsig, const unsigned ch
     if (!BN_bin2bn(msg, msglen, e)) { ret=-1; goto err; }
     if (8*msglen > n) BN_rshift(e, e, 8-(n & 7));
     zero = BN_CTX_get(ctx);
-    BN_zero(zero);
+    if (!BN_set_word(zero, 0)) { ret=-1; goto err; }
     if (!BN_mod_sub(e, zero, e, order, ctx)) { ret=-1; goto err; }
     rr = BN_CTX_get(ctx);
     if (!BN_mod_inverse(rr, ecsig_r, order, ctx)) { ret=-1; goto err; }