Return 0 if the given seckey is invalid in privkey_negate, privkey_tweak_add and privkey_tweak_mul

This commit is contained in:
Jonas Nick committed 2020-03-30 20:51:47 +00:00
1 parent 8f814cddb9
commit 5894e1f1df
4 files changed
+77 -20

No files matched your search

+1 -4
View File
@@ -54,10 +54,7 @@ static int secp256k1_eckey_pubkey_serialize(secp256k1_ge *elem, unsigned char *p
static int secp256k1_eckey_privkey_tweak_add(secp256k1_scalar *key, const secp256k1_scalar *tweak) {
secp256k1_scalar_add(key, key, tweak);
if (secp256k1_scalar_is_zero(key)) {
return 0;
}
return 1;
return !secp256k1_scalar_is_zero(key);
}
static int secp256k1_eckey_pubkey_tweak_add(const secp256k1_ecmult_context *ctx, secp256k1_ge *key, const secp256k1_scalar *tweak) {