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

Remove use of PassthroughDigest from EthereumPersonalSignature2021 #337

Merged
merged 2 commits into from
Oct 28, 2021

Conversation

clehner
Copy link
Contributor

@clehner clehner commented Oct 27, 2021

This PR is to simplify code and reduce reliance on PassthroughDigest.

EthereumPersonalSignature2021 in src/ldp.rs involves Keccak256 hashing. This is using try_sign_digest and recover_verify_key_from_digest_bytes with PassthroughDigest. k256 includes default signing and verification functions using Keccak256 already, which is used in other places in ldp.rs. This PR updates EthereumPersonalSignature2021 to use those functions as well - i.e. try_sign and recover_verify_key with k256::ecdsa::recoverable::Signature.

To ensure the signing still works, a test is added in did-pkh. Verifying continues to be tested in did-pkh via static test vectors.

Do Keccak256 hashing using try_sign and recover_verify_key functions,
rather than in hash_personal_message.
@clehner clehner marked this pull request as ready for review October 27, 2021 20:07
@clehner clehner merged commit 697e055 into main Oct 28, 2021
@clehner clehner deleted the fix/remove-passthrough-digest-ldp branch October 28, 2021 13:09
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.

2 participants