nakov / Practical-Cryptography-for-Developers-Book

Practical Cryptography for Developers: Hashes, MAC, Key Derivation, DHKE, Symmetric and Asymmetric Ciphers, Public Key Cryptosystems, RSA, Elliptic Curves, ECC, secp256k1, ECDH, ECIES, Digital Signatures, ECDSA, EdDSA
https://cryptobook.nakov.com
MIT License
3.42k stars 409 forks source link

Error in the ecdsa Sign procedure ? #65

Open Fabien-Morrow opened 1 year ago

Fabien-Morrow commented 1 year ago

I think there's a small error in the ECDSA Sign procedure described in this page. r will not always be smaller than n, r is just smaller than p. I propose this small change to ensure r is always smaller than n, keeping things simple at this step, and letting the reader to dive into malleability stuff once he grabbed the procedure.