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

ecdsa: optimize trial_recovery_from_prehash using recover_from_prehash_noverify #832

Merged
merged 1 commit into from
Jul 25, 2024

Conversation

XuJiandong
Copy link
Contributor

Since the recovered public key is eventually authenticated through comparison, verifying the public key on each attempt is unnecessary.

@tarcieri
Copy link
Member

I think this would probably also benefit from the _noverify pattern and worry about potential problems if the signature doesn’t verify

Comment on lines 146 to 150
verify_prehashed::<C>(
&ProjectivePoint::<C>::from(*vk.as_affine()),
&bits2field::<C>(prehash)?,
signature,
)?;
Copy link
Member

Choose a reason for hiding this comment

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

You could also do this first thing since you already have the key and signature

…hash_noverify`

verifying the public key on each attempt is unnecessary. Just verify
once.
@XuJiandong XuJiandong force-pushed the optimize-trial-recovery branch from 7dd9cc2 to f49277a Compare July 25, 2024 01:47
@tarcieri tarcieri merged commit 73a8922 into RustCrypto:master Jul 25, 2024
8 checks passed
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