From e96bf96f8b1ef14db7694d0e8e9753d87a47e491 Mon Sep 17 00:00:00 2001 From: Loup Vaillant Date: Mon, 29 Jun 2020 00:40:50 +0200 Subject: [PATCH] Added Kleshni/Elligator-2 test vectors An auditor recently told me about the following repository on GitHub: https://github.com/Kleshni/Elligator-2/ I was able to steal a couple test vectors from them. Not all of them unfortunately: - Some representative exceed 2^254, and Monocypher do not decode negative representatives. Instead, it assumes it has a positive representative, and clears the two most significant bits before decoding. - It is not clear yet what encoding does, and some points in the (few) test vectors have their most significant bit set. Monocypher ignores the most significant bit of curve point, basically assumes they are all below 2^255 - 19. Adding those points will require tweaking similar to the tweaking applied to the Hash to Curve RFC draft test vectors. --- tests/gen/vectors/elligator_dir | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/gen/vectors/elligator_dir b/tests/gen/vectors/elligator_dir index a2d4a07..c0f3491 100644 --- a/tests/gen/vectors/elligator_dir +++ b/tests/gen/vectors/elligator_dir @@ -69,3 +69,20 @@ b1acbbf9410113a467ae0d3731894cc67a131208af70e2f16758a4be0bb6706c: 7a48adebb692fdb8e5a2176389f3f0bcbdc1956b0d57acac4a8eda87b577e618: 22997bed0e3c6023e73fb371e6d3c5c3661a87c6f3f787ba6054e699aef5aa64: + + + +e73507d38bae63992b3f57aac48c0abc14509589288457995a2b4ca3490aa207: +1e8afffed6bf53fe271ad572473262ded8faec68e5e67ef45ebb82eeba52604f: + +95a16019041dbefed9832048ede11928d90365f24a38aa7aef1b97e23954101b: +794f05ba3e3a72958022468c88981e0be5782be1e1145ce2c3c6fde16ded5363: + +f6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff3f: +9cdb525555555555555555555555555555555555555555555555555555555555: + +f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff3f: +9cdb525555555555555555555555555555555555555555555555555555555555: + +0000000000000000000000000000000000000000000000000000000000000000: +0000000000000000000000000000000000000000000000000000000000000000: -- 2.47.3