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

k256: recoverable::Signature::recover_verify_key_from_digest_bytes #205

Merged
merged 1 commit into from
Sep 26, 2020

Conversation

tarcieri
Copy link
Member

Adds a recover_verify_key_from_digest_bytes method which operates on a byte array that's allegedy the digest of the message used to produce a given signature.

Where *Verifier methods carry the risk of a signature forgery if they operate on something that's not a message digest (since this violates ROM under which ECDSA derives its security), there isn't a similar risk for public key recovery: the best an attacker can do is force recovery of a bogus key, and all recovered public keys are inherently untrusted until they can be validated against a key fingerprint. So this method doesn't have similar misuse concerns as signature verification.

Adds a `recover_verify_key_from_digest_bytes` method which operates on a
byte array that's allegedy the digest of the message used to produce a
given signature.

Where `*Verifier` methods carry the risk of a signature forgery if they
operate on something that's not a message digest (since this violates
ROM under which ECDSA derives its security), there isn't a similar risk
for public key recovery: the best an attacker can do is force recovery
of a bogus key, and all recovered public keys are inherently untrusted
until they can be validated against a key fingerprint. So this method
doesn't have similar misuse concerns as signature verification.
@codecov-commenter
Copy link

Codecov Report

Merging #205 into master will decrease coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #205      +/-   ##
==========================================
- Coverage   58.70%   58.67%   -0.04%     
==========================================
  Files          25       25              
  Lines        3775     3777       +2     
==========================================
  Hits         2216     2216              
- Misses       1559     1561       +2     
Impacted Files Coverage Δ
k256/src/ecdsa/recoverable.rs 59.74% <100.00%> (+1.07%) ⬆️
k256/src/arithmetic/scalar.rs 77.86% <0.00%> (-0.77%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0f02ba7...9aa3fd9. Read the comment docs.

@tarcieri tarcieri merged commit e29883a into master Sep 26, 2020
@tarcieri tarcieri deleted the k256/recover-signature-from-raw-digest-bytes branch September 26, 2020 01:17
@tarcieri tarcieri mentioned this pull request Sep 27, 2020
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