diff options
author | Dwayne C. Litzenberger <dlitz@dlitz.net> | 2009-10-10 15:47:51 -0400 |
---|---|---|
committer | Dwayne C. Litzenberger <dlitz@dlitz.net> | 2009-10-12 14:41:14 -0400 |
commit | f189a040326eb479ee19a9cd82c54ebf1de0e893 (patch) | |
tree | ef7943b853700675277185cb4d054b1dfde66803 /lib/Crypto/Util | |
parent | cd3ab06485629354ad5531d18c9eb88b631f27d3 (diff) | |
download | pycrypto-f189a040326eb479ee19a9cd82c54ebf1de0e893.tar.gz |
Counter: Add disable_shortcut keyword argument (to be used for testing)
Diffstat (limited to 'lib/Crypto/Util')
-rw-r--r-- | lib/Crypto/Util/Counter.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Crypto/Util/Counter.py b/lib/Crypto/Util/Counter.py index 7385565..c3001e4 100644 --- a/lib/Crypto/Util/Counter.py +++ b/lib/Crypto/Util/Counter.py @@ -28,7 +28,7 @@ from Crypto.Util import _counter import struct # Factory function -def new(nbits, prefix="", suffix="", initial_value=1, overflow=0, little_endian=False): +def new(nbits, prefix="", suffix="", initial_value=1, overflow=0, little_endian=False, disable_shortcut=False): # TODO: Document this # Sanity-check the message size @@ -43,9 +43,9 @@ def new(nbits, prefix="", suffix="", initial_value=1, overflow=0, little_endian= initval = _encode(initial_value, nbytes, little_endian) if little_endian: - return _counter._newLE(str(prefix), str(suffix), initval) + return _counter._newLE(str(prefix), str(suffix), initval, disable_shortcut=disable_shortcut) else: - return _counter._newBE(str(prefix), str(suffix), initval) + return _counter._newBE(str(prefix), str(suffix), initval, disable_shortcut=disable_shortcut) def _encode(n, nbytes, little_endian=False): retval = [] |