]> git.codecow.com Git - Monocypher.git/commitdiff
Elligator Script: fixed short test vectors
authorLoup Vaillant <loup@loup-vaillant.fr>
Mon, 16 Mar 2020 21:01:15 +0000 (22:01 +0100)
committerLoup Vaillant <loup@loup-vaillant.fr>
Mon, 16 Mar 2020 21:01:15 +0000 (22:01 +0100)
tests/gen/elligator_scalarmult.py

index 05da5eb54afbaf680b14091069b4c32bbaa6a050..1af6937c5e8f92fb800ffc6391101ea3427ae095 100644 (file)
@@ -57,9 +57,10 @@ from elligator import sqrtm1
 
 def print_scalar(scalar):
     """prints a scalar element in little endian"""
-    while scalar != 0:
+    for _ in range(32):
         print(format(scalar % 256, '02x'), end='')
         scalar //= 256
+    if scalar != 0: raise ValueError('number is too big!!')
     print(':')
 
 #########################################