aboutsummaryrefslogtreecommitdiff
path: root/src/test/ed25519_exts_ref.py
diff options
context:
space:
mode:
authorcclauss <cclauss@me.com>2020-01-28 01:38:54 +0100
committercclauss <cclauss@me.com>2020-01-28 01:38:54 +0100
commit3208a74f906c116e93074c6ed0559df1cbfe58d1 (patch)
treec43d03841d5c29d4a8fc29793ef71eebc065d989 /src/test/ed25519_exts_ref.py
parentaba31e2187808257b250bf469895330f273d7746 (diff)
downloadtor-3208a74f906c116e93074c6ed0559df1cbfe58d1.tar.gz
tor-3208a74f906c116e93074c6ed0559df1cbfe58d1.zip
Use print() function in both Python 2 and Python 3
Diffstat (limited to 'src/test/ed25519_exts_ref.py')
-rw-r--r--src/test/ed25519_exts_ref.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/test/ed25519_exts_ref.py b/src/test/ed25519_exts_ref.py
index 658f7cde12..ae537ff15b 100644
--- a/src/test/ed25519_exts_ref.py
+++ b/src/test/ed25519_exts_ref.py
@@ -152,7 +152,7 @@ class SelfTest(unittest.TestCase):
# Check that identities match
assert(identity == identity2)
# Check that identity is the point (0,1)
- assert(identity == [0L,1L])
+ assert(identity == [0,1])
# Check identity element: a*E = E, where a is a random scalar
scalar = random_scalar(os.urandom)
@@ -186,22 +186,22 @@ BLINDING_PARAMS = [
PREFIX = "ED25519_"
def writeArray(name, array):
- print "static const char *{prefix}{name}[] = {{".format(
- prefix=PREFIX,name=name)
+ print("static const char *{prefix}{name}[] = {{".format(
+ prefix=PREFIX,name=name))
for a in array:
h = binascii.b2a_hex(a)
if len(h) > 70:
h1 = h[:70]
h2 = h[70:]
- print ' "{0}"\n "{1}",'.format(h1,h2)
+ print(' "{0}"\n "{1}",'.format(h1,h2))
else:
- print ' "{0}",'.format(h)
- print "};\n"
+ print(' "{0}",'.format(h))
+ print("};\n")
def comment(text, initial="/**"):
- print initial
- print textwrap.fill(text,initial_indent=" * ",subsequent_indent=" * ")
- print " */"
+ print(initial)
+ print(textwrap.fill(text,initial_indent=" * ",subsequent_indent=" * "))
+ print(" */")
def makeTestVectors():
comment("""Test vectors for our ed25519 implementation and related
@@ -257,7 +257,7 @@ def makeTestVectors():
if __name__ == '__main__':
import sys
if len(sys.argv) == 1 or sys.argv[1] not in ("SelfTest", "MakeVectors"):
- print "You should specify one of 'SelfTest' or 'MakeVectors'"
+ print("You should specify one of 'SelfTest' or 'MakeVectors'")
sys.exit(1)
if sys.argv[1] == 'SelfTest':
unittest.main()