]> git.codecow.com Git - Monocypher.git/commit
Improved readability of EdDSA verification
authorLoup Vaillant <loup@loup-vaillant.fr>
Fri, 24 Jan 2020 21:19:32 +0000 (22:19 +0100)
committerLoup Vaillant <loup@loup-vaillant.fr>
Fri, 24 Jan 2020 21:29:58 +0000 (22:29 +0100)
commit6df0c6d80c6687cf3e3a248b09c3cb5f7047860b
tree16deefdc5e0d5dcbf234314b31f4fd11bd8ba0a0
parentcf46e1706e2686620d7ac7ee1885deb206be6e8d
Improved readability of EdDSA verification

Basically, we separated the computation of R_check from the verification
that it is equal to R. The computation of R_check takes s, h_ram and the
public key as parameter, and output R_check.

The primary advantage is a better separation of concerns, which makes
the code more readable in my opinion.

A secondary advantage is that we could now test ge_r_check() separately,
with arbitrary values of s and h_ram.  This lets us test difficult to
trigger edge cases, like having s or h_ram exceeding 2^252, and is just
plain more general than only testing valid and invalid signatures.

I very much like this secondary advantage, because EdDSA is to this day
the part of Monocypher that makes me the most nervous.
src/monocypher.c