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

index 14194a6d2253e591aff70759e3add48234176169..ae91e9d6d4d67aa4c2c3ad7d35dfa609da7ee01c 100755 (executable)
@@ -124,15 +124,6 @@ def curve_to_hash(point):
     if v.is_positive(): return sq1
     else              : return sq2
 
-# round trip test
-for i in range(50):
-    h   = fe(1234567890 * i).invert() # "random" hash
-    pp  = hash_to_curve(h)
-    hh  = curve_to_hash(pp)
-    ppp = hash_to_curve(hh)
-    if hh != h.abs() : raise ValueError('h != hh')
-    if pp != ppp     : raise ValueError('pp != ppp')
-
 # Edwards (Edwards25519)
 # -x^2 + y^2 = 1 + d*x^2*y^2
 d = fe(-121665) / fe(121666)