diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-08-31 19:45:56 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-09-25 15:08:32 -0400 |
commit | 698134176473e33ef001f05f67ff83755c45091f (patch) | |
tree | ecb2b867e326b4857e33cbb87d00b281ae7dfc39 /src/test/ed25519_exts_ref.py | |
parent | 7ca470e13c70eaff483010e4b5c8f1f3076b3b7e (diff) | |
download | tor-698134176473e33ef001f05f67ff83755c45091f.tar.gz tor-698134176473e33ef001f05f67ff83755c45091f.zip |
Cut the time to run the python ed25519 tests by a factor of ~6
I know it's pointless to optimize them, but I just can't let them
spend all that time in expmod() when native python pow() does the same
thing.
Diffstat (limited to 'src/test/ed25519_exts_ref.py')
-rw-r--r-- | src/test/ed25519_exts_ref.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/ed25519_exts_ref.py b/src/test/ed25519_exts_ref.py index 199e1e1676..0df5541d10 100644 --- a/src/test/ed25519_exts_ref.py +++ b/src/test/ed25519_exts_ref.py @@ -8,6 +8,7 @@ Includes self-tester and test vector generator. """ +import slow_ed25519 from slow_ed25519 import * import os @@ -20,8 +21,7 @@ import binascii ell = l # This replaces expmod above and makes it go a lot faster. -def expmod(b,e,m): - return pow(b,e,m) +slow_ed25519.expmod = pow def curve25519ToEd25519(c, sign): u = decodeint(c) |