/opt/alt/python27/lib64/python2.7/site-packages/Crypto/Util
NameSizeModeActions
asn1.py127270644editdlrm
asn1.pyc142050644editdlrm
asn1.pyo142050644editdlrm
Counter.py51570644editdlrm
Counter.pyc42640644editdlrm
Counter.pyo42640644editdlrm
number.py954880644editdlrm
number.pyc1138970644editdlrm
number.pyo1138450644editdlrm
py3compat.py39120644editdlrm
py3compat.pyc42730644editdlrm
py3compat.pyo42730644editdlrm
py21compat.py27790644editdlrm
py21compat.pyc14770644editdlrm
py21compat.pyo14770644editdlrm
randpool.py27680644editdlrm
randpool.pyc34080644editdlrm
randpool.pyo34080644editdlrm
RFC1751.py211860644editdlrm
RFC1751.pyc293540644editdlrm
RFC1751.pyo293540644editdlrm
strxor.so222570755editdlrm
winrandom.py11960644editdlrm
winrandom.pyc2530644editdlrm
winrandom.pyo2530644editdlrm
_counter.so395660755editdlrm
_number_new.py40510644editdlrm
_number_new.pyc36610644editdlrm
_number_new.pyo35330644editdlrm
__init__.py15070644editdlrm
__init__.pyc7310644editdlrm
__init__.pyo7310644editdlrm
Edit: /opt/alt/python27/lib64/python2.7/site-packages/Crypto/Util/Counter.pyo (4264B)
Ñò Bd\Rc @s¨dZddkZeiddjo"eiddjoddkTnddkTddklZddkZedƒedƒdde e e d „Z e d „Z dS( s«Fast counter functions for CTR cipher modes. CTR is a chaining mode for symmetric block encryption or decryption. Messages are divideded into blocks, and the cipher operation takes place on each block using the secret key and a unique *counter block*. The most straightforward way to fulfil the uniqueness property is to start with an initial, random *counter block* value, and increment it as the next block is processed. The block ciphers from `Crypto.Cipher` (when configured in *MODE_CTR* mode) invoke a callable object (the *counter* parameter) to get the next *counter block*. Unfortunately, the Python calling protocol leads to major performance degradations. The counter functions instantiated by this module will be invoked directly by the ciphers in `Crypto.Cipher`. The fact that the Python layer is bypassed lead to more efficient (and faster) execution of CTR cipher modes. An example of usage is the following: >>> from Crypto.Cipher import AES >>> from Crypto.Util import Counter >>> >>> pt = b''*1000000 >>> ctr = Counter.new(128) >>> cipher = AES.new(b''*16, AES.MODE_CTR, counter=ctr) >>> ct = cipher.encrypt(pt) :undocumented: __package__ iÿÿÿÿNiii(t*(t_countertc Csçt|dƒ\}} | djotd|fƒ‚n|djotdƒ‚n|djotdƒ‚nt|||ƒ} |o,tit|ƒt|ƒ| d|d |ƒStit|ƒt|ƒ| d|d |ƒSd S( scCreate a stateful counter block function suitable for CTR encryption modes. Each call to the function returns the next counter block. Each counter block is made up by three parts:: prefix || counter value || postfix The counter value is incremented by one at each call. :Parameters: nbits : integer Length of the desired counter, in bits. It must be a multiple of 8. prefix : byte string The constant prefix of the counter block. By default, no prefix is used. suffix : byte string The constant postfix of the counter block. By default, no suffix is used. initial_value : integer The initial value of the counter. Default value is 1. little_endian : boolean If True, the counter number will be encoded in little endian format. If False (default), in big endian format. allow_wraparound : boolean If True, the function will raise an *OverflowError* exception as soon as the counter wraps around. If False (default), the counter will simply restart from zero. disable_shortcut : boolean If True, do not make ciphers from `Crypto.Cipher` bypass the Python layer when invoking the counter block function. If False (default), bypass the Python layer. :Returns: The counter block function. iis%nbits must be a multiple of 8; got %disnbits too smalliÿÿsnbits too largetallow_wraparoundtdisable_shortcutN(tdivmodt ValueErrort_encodeRt_newLEtbstrt_newBE( tnbitstprefixtsuffixt initial_valuetoverflowt little_endianRRtnbytest remaindertinitval((sF/opt/alt/python27/lib64/python2.7/site-packages/Crypto/Util/Counter.pytnew?s%   ,cCs‚g}t|ƒ}xZt|ƒD]L}|o|it|d@ƒƒn|idt|d@ƒƒ|dL}qWtdƒi|ƒS(NiÿiiR(tlongtrangetappendtbchrtinserttbtjoin(tnRRtretvalti((sF/opt/alt/python27/lib64/python2.7/site-packages/Crypto/Util/Counter.pyRts  ( t__doc__tsyst version_infotCrypto.Util.py21compattCrypto.Util.py3compatt Crypto.UtilRtstructRtFalseRR(((sF/opt/alt/python27/lib64/python2.7/site-packages/Crypto/Util/Counter.pyt5s (  *5