diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-11-16 22:42:22 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-11-16 22:42:22 -0500 |
commit | 7c0778ef7e05e859c62346a795952f127972b35e (patch) | |
tree | 80ea2c12ced79f6f54ec209e2041a33d90197e8d /src/test/hs_ntor_ref.py | |
parent | fd22fa183befb2976aff042a4a2b052938c33b03 (diff) | |
parent | fcae26adf710cf1fe393fde723e9a2caf6012b09 (diff) | |
download | tor-7c0778ef7e05e859c62346a795952f127972b35e.tar.gz tor-7c0778ef7e05e859c62346a795952f127972b35e.zip |
Merge branch 'maint-0.3.5' into maint-0.4.3
Diffstat (limited to 'src/test/hs_ntor_ref.py')
-rw-r--r-- | src/test/hs_ntor_ref.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/test/hs_ntor_ref.py b/src/test/hs_ntor_ref.py index f107cc36ca..98025dd584 100644 --- a/src/test/hs_ntor_ref.py +++ b/src/test/hs_ntor_ref.py @@ -70,14 +70,16 @@ except ImportError: try: # Pull the sha3 functions in. from hashlib import sha3_256, shake_256 - shake_squeeze = shake_256.digest + def shake_squeeze(obj, n): + return obj.digest(n) except ImportError: if hasattr(sha3, "SHA3256"): # If this happens, then we have the old "sha3" module which # hashlib and pysha3 superseded. sha3_256 = sha3.SHA3256 shake_256 = sha3.SHAKE256 - shake_squeeze = shake_256.squeeze + def shake_squeeze(obj, n): + return obj.squeeze(n) else: # error code 77 tells automake to skip this test sys.exit(77) |