Skip to content

Implement ECDSA nonce hardening to protect against bad PRNG.#662

Merged
briansmith merged 2 commits into
masterfrom
b/ecdsa-nonce-hardening-2
May 30, 2020
Merged

Implement ECDSA nonce hardening to protect against bad PRNG.#662
briansmith merged 2 commits into
masterfrom
b/ecdsa-nonce-hardening-2

Conversation

@briansmith

Copy link
Copy Markdown
Owner

No description provided.

@briansmith

Copy link
Copy Markdown
Owner Author

This is a work in progress. It would be great to get some feedback on this. I actually don't like this nonce derivation scheme much, but we have a bit of analysis paralysis in coming up with a better one, so I'm going with this as an approximation of "Make it work like we'd more-or-less transliterated the BoringSSL code to Rust two years ago."

@ctz Could you check this out and see if it makes sense to you?

@briansmith briansmith force-pushed the b/ecdsa-nonce-hardening-2 branch from 706dee7 to 27fd856 Compare June 12, 2018 00:25
@briansmith briansmith changed the title Implement ECDSA nonce hardening to pretect against bad PRNG. Implement ECDSA nonce hardening to protect against bad PRNG. Jun 12, 2018
@ctz

ctz commented Jul 6, 2018

Copy link
Copy Markdown
Contributor

I'll write out what I see to check understanding. With:

  • H: hash function associated with signature, with image size |h| and MD block size |H| in bits
  • q: group size
  • d: private scalar, |q|-length encoding in the usual way
  • H(m): hash of message being signed
  • $n: n random bits

Precompute:

  • dnrk = H($|q| || d)

Per-signature:

  • k = H(dnrk || $|H| - |h| || H(m))

If that's accurate it looks good to me.

@briansmith briansmith force-pushed the b/ecdsa-nonce-hardening-2 branch from 27fd856 to b35a460 Compare May 30, 2020 00:45
@briansmith briansmith merged commit 432670f into master May 30, 2020
@briansmith briansmith deleted the b/ecdsa-nonce-hardening-2 branch May 30, 2020 02:43
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