Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ec: validate that a point before deriving keys
This update checks to make sure that the public key passed in to ECDH is a point that actually exists on the curve. This is important to prevent a twist attack that can be used to reveal the private key of a party in an ECDH operation over a number of occurances. For more details on the attack see this blog post: https://github.com/christianlundkvist/blog/blob/master/2020_05_26_secp256k1_twist_attacks/secp256k1_twist_attacks.md CVE: CVE-2020-28498
- Loading branch information
Why wrap in an
if
statement? Why not justassert
?