Skip to content
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

Add support for BIP340 signtures where the messages are not exactly 32 bytes #1041

Merged

Conversation

randombit
Copy link
Contributor

This was an extension to BIP340 that was introduced in 2022. The official BIP340 test vectors do contain data for this case (tests 15-18) which are included here.

Fixes #1040

@@ -78,7 +78,7 @@ impl SigningKey {
/// The preferred interfaces are the [`Signer`] or [`RandomizedSigner`] traits.
pub fn sign_prehash_with_aux_rand(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this method should be renamed to reflect the input is no longer necessarily a prehash?

Something like sign_raw perhaps?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah makes sense, I renamed to sign_raw. I didn't know if you wanted to keep any compatability forwarding (eg a #[deprecated] sign_prehash_with_aux_rand that forwards to sign_raw), so I left it out for now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fine. We can make a note in the changelog.

@tarcieri tarcieri merged commit a1fabfb into RustCrypto:master Apr 24, 2024
19 checks passed
altkdf pushed a commit to altkdf/elliptic-curves that referenced this pull request Jun 5, 2024
This was an extension to BIP340 that was introduced in 2022.

The official BIP340 test vectors do contain data for this case (tests 15-18) which are included here.

Fixes RustCrypto#1040
@randombit randombit mentioned this pull request Aug 9, 2024
randombit added a commit to randombit/elliptic-curves that referenced this pull request Aug 29, 2024
This is a backport of RustCrypto#1041 onto the 0.13 branch, with some
small changes to accomodate SemVer.

Fixes RustCrypto#1040
tarcieri pushed a commit that referenced this pull request Sep 20, 2024
This is a backport of #1041 onto the 0.13 branch, with some
small changes to accomodate SemVer.

Fixes #1040
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BIP340 Schnorr should accept arbitrary length messages
2 participants