]> git.codecow.com Git - Monocypher.git/commit
Added easy interface for Elligator
authorLoup Vaillant <loup@loup-vaillant.fr>
Wed, 18 Mar 2020 11:27:31 +0000 (12:27 +0100)
committerLoup Vaillant <loup@loup-vaillant.fr>
Wed, 18 Mar 2020 11:27:31 +0000 (12:27 +0100)
commitbc1ba59d9521fd19bb5bfde12681399a20359549
tree594f49e0a173f76eccbf6a141c2bb6b7ca3eef3c
parentf0d0f482c929cf1799679d2518740a1c503a1dce
Added easy interface for Elligator

Note a small problem in the implementation: we are reusing one byte for
both the tweak and the next random seed.  This makes them *not*
independent, and a possible source of vulnerability.

In practice, this is only a problem for the 3 bits comprising the
cofactor, since the sign and the padding do not play a role in deciding
whether the mapping fails or succeeds.

TODO: take the cofactor from the clamped bits of the scalar, instead of
the tweak. This will ensure proper independence, while keeping the high
level code simple and maximally efficient.
src/monocypher.c
src/monocypher.h
tests/test.c