-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Policy for SECP256K1_WARN_UNUSED_RESULT #961
Comments
Ok, I was wrong. The correct statement is that the default nonce generation will never fail. Do you have an opinion about |
Originally posted by @jonasnick in #1479 (comment) |
The default nonce generation function will fail only with astronomically low probability. So if you know that you have a valid secret key and you use the default nonce function (99% of the use cases), it's okay not to check the return value.
Having said that, I think we're not entirely consistent here... For example, the same argument would apply to
secp256k1_ec_seckey_verify
(https://github.com/bitcoin-core/secp256k1/blob/master/include/secp256k1.h#L632). Evensecp256k1_ec_pubkey_negate
https://github.com/bitcoin-core/secp256k1/blob/master/include/secp256k1.h#L650 has
SECP256K1_WARN_UNUSED_RESULT
even if it's guaranteed to return 1 according to the docs...Maybe we should have a look at this in #783 or in a follow up PR.
Originally posted by @real-or-random in #960 (comment)
So I wonder what our (unwritten) policy for
SECP256K1_WARN_UNUSED_RESULT
should be. I think we're overdoing it in the two mentioned cases but I'm happy to hear other opinions.The text was updated successfully, but these errors were encountered: