This fixes #307 if there's nothing else that's confusing.
Rename msg32 to msghash32 in ecdsa_sign/verify and add explanation #854
pull jonasnick wants to merge 2 commits into bitcoin-core:master from jonasnick:msghash changing 4 files +70 −63-
jonasnick commented at 3:56 PM on December 3, 2020: contributor
-
in include/secp256k1.h:461 in cec7cfd9b1 outdated
457 | + * must make sure to apply a cryptographic hash function to 458 | + * the message by itself and not accept an msghash32 value 459 | + * directly. Otherwise, it would be easy to create a 460 | + * "valid" signature without knowledge of the secret key. 461 | + * See also https://bitcoin.stackexchange.com/a/81116/35586 462 | + * for more background on this topic. (cannot be NULL)
real-or-random commented at 8:53 PM on December 3, 2020:maybe move the "cannot be NULL" up again.
Otherwise it's "See also https://bitcoin.stackexchange.com/a/81116/35586 for more background on this topic. (cannot be NULL)", which confused me. We could also move the explanation to the body alternatively.
jonasnick commented at 2:17 PM on December 4, 2020:Fixed
real-or-random commented at 8:58 PM on December 3, 2020: contributorWe should do the same for the functions in the recovery module.
One more thing that I noticed is that extrakeys module says "tweak32" whereas the other functions have just "tweak". I think "tweak32" is better. The number suffixes are really neat.
I think the only exception where we don't use them is "seckey". (Maybe because this thing is so common that people should not get it wrong.)
Rename msg32 to msghash32 in ecdsa_sign/verify and add explanation f587f04e35Rename tweak to tweak32 in public API 6e85d675aajonasnick force-pushed on Dec 4, 2020jonasnick commented at 2:18 PM on December 4, 2020: contributorGood points. Renamed msg32 also in recovery module and added commit that renames tweak to tweak32.
real-or-random commented at 4:38 PM on December 4, 2020: contributorACK 6e85d675aaf9dc17842096f9cbf8cfab216c9331 I inspected the diff
apoelstra approvedapoelstra commented at 12:34 AM on December 5, 2020: contributorack 6e85d675aaf9dc17842096f9cbf8cfab216c9331
gmaxwell commented at 7:50 PM on December 7, 2020: contributorlooks fine to me.
real-or-random merged this on Dec 7, 2020real-or-random closed this on Dec 7, 2020Fabcien referenced this in commit b9aaa07a18 on Apr 8, 2021deadalnix referenced this in commit 156ca47cad on Apr 9, 2021
This is a metadata mirror of the GitHub repository bitcoin-core/secp256k1. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-14 15:15 UTC
More mirrored repositories can be found on mirror.b10c.me