aboutsummaryrefslogtreecommitdiff
path: root/src/test/slownacl_curve25519.py
diff options
context:
space:
mode:
authorteor <teor@torproject.org>2019-12-12 15:58:51 +1000
committerteor <teor@torproject.org>2019-12-12 15:58:51 +1000
commit1619f14a0420b0a57d65b9adeab8e8a4ef222b3a (patch)
treee58abb1dd7d9bae4d48ca00fb7b10b837d952a67 /src/test/slownacl_curve25519.py
parenta38014e5c6fa7955e9af61b42eddb2bc9edc29a9 (diff)
downloadtor-1619f14a0420b0a57d65b9adeab8e8a4ef222b3a.tar.gz
tor-1619f14a0420b0a57d65b9adeab8e8a4ef222b3a.zip
python: Add __future__ imports for python 3 compatibility
Except for src/ext, which we may not want to modify. Closes ticket 32732.
Diffstat (limited to 'src/test/slownacl_curve25519.py')
-rw-r--r--src/test/slownacl_curve25519.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/test/slownacl_curve25519.py b/src/test/slownacl_curve25519.py
index 4dabab61b6..0cafe0e71f 100644
--- a/src/test/slownacl_curve25519.py
+++ b/src/test/slownacl_curve25519.py
@@ -6,10 +6,15 @@
# Nick got the slownacl source from:
# https://github.com/mdempsky/dnscurve/tree/master/slownacl
-__all__ = ['smult_curve25519_base', 'smult_curve25519']
+# Future imports for Python 2.7, mandatory in 3.0
+from __future__ import division
+from __future__ import print_function
+from __future__ import unicode_literals
import sys
+__all__ = ['smult_curve25519_base', 'smult_curve25519']
+
P = 2 ** 255 - 19
A = 486662