fix(k256): ecdsa verify needs custom hook#1744
Merged
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
6b7d55b to
ad8aab9
Compare
This comment has been minimized.
This comment has been minimized.
ad8aab9 to
8e983c9
Compare
This comment has been minimized.
This comment has been minimized.
Avaneesh-axiom
approved these changes
Jun 16, 2025
b8e630c to
86ff576
Compare
For some reason, unlike other libraries, the k256 crate has a special requirement that the signature is normalized ahead of time: https://github.com/RustCrypto/elliptic-curves/blob/5ac8f5d77f11399ff48d87b0554935f6eddda342/k256/src/ecdsa.rs#L203 To handle this, we introduce a new trait `VerifyCustomHook` that is called both in `recover_prehashed` and `verify_prehash`.
5c50bf3 to
8bc272e
Compare
Commit: 8bc272e |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For some reason, unlike other libraries, the k256 crate has a special requirement that the signature is normalized ahead of time: https://github.com/RustCrypto/elliptic-curves/blob/5ac8f5d77f11399ff48d87b0554935f6eddda342/k256/src/ecdsa.rs#L203 To handle this, we introduce a new trait
VerifyCustomHookthat is called both inrecover_prehashedandverify_prehash.recover_prehashedto callverify_prehashagain.