]> git.codecow.com Git - Monocypher.git/commitdiff
Elligator script: test explicit_hash_to_curve
authorLoup Vaillant <loup@loup-vaillant.fr>
Sun, 23 Feb 2020 10:46:27 +0000 (11:46 +0100)
committerLoup Vaillant <loup@loup-vaillant.fr>
Sun, 23 Feb 2020 10:46:27 +0000 (11:46 +0100)
tests/gen/elligator.py

index ae91e9d6d4d67aa4c2c3ad7d35dfa609da7ee01c..cab89792d790bd4f9179bd47aaa0e2fed22a4301 100755 (executable)
@@ -247,7 +247,9 @@ def full_cycle_check(scalar, u):
         print('01:')    # Success
         h.print()       # actual value for the hash
         c = hash_to_curve(h)
-        if c != uv: raise ValueError('Round trip failure')
+        u = explicit_hash_to_curve(h)
+        if u != c[0]: raise ValueError('Incorrect explicit_hash_to_curve()')
+        if c != uv  : raise ValueError('Round trip failure')
     else:
         print('00:')    # Failure
         print('00:')    # dummy value for the hash