GRAYBYTE WORDPRESS FILE MANAGER9771

Server IP : 198.54.121.189 / Your IP : 216.73.216.112
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /opt/imunify360/venv/lib/python3.11/site-packages/Crypto/Util/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


Current File : /opt/imunify360/venv/lib/python3.11/site-packages/Crypto/Util//Counter.py
# -*- coding: ascii -*-
#
#  Util/Counter.py : Fast counter for use with CTR-mode ciphers
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain.  To
# the extent that dedication to the public domain is not available,
# everyone is granted a worldwide, perpetual, royalty-free,
# non-exclusive license to exercise all rights associated with the
# contents of this file for any purpose whatsoever.
# No rights are reserved.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# ===================================================================

def new(nbits, prefix=b"", suffix=b"", initial_value=1, little_endian=False, allow_wraparound=False):
    """Create 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 1 at each call.

    Args:
      nbits (integer):
        Length of the desired counter value, 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.
        Its length in bits must not exceed the argument ``nbits``.
      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):
        This parameter is ignored.
    Returns:
      An object that can be passed with the :data:`counter` parameter to a CTR mode
      cipher.

    It must hold that *len(prefix) + nbits//8 + len(suffix)* matches the
    block size of the underlying block cipher.
    """

    if (nbits % 8) != 0:
        raise ValueError("'nbits' must be a multiple of 8")

    iv_bl = initial_value.bit_length()
    if iv_bl > nbits:
        raise ValueError("Initial value takes %d bits but it is longer than "
                         "the counter (%d bits)" %
                         (iv_bl, nbits))

    # Ignore wraparound
    return {"counter_len": nbits // 8,
            "prefix": prefix,
            "suffix": suffix,
            "initial_value": initial_value,
            "little_endian": little_endian
            }

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
July 02 2025 08:36:55
root / root
0755
__pycache__
--
July 02 2025 08:36:55
root / root
0755
Counter.py
3.037 KB
June 09 2025 11:12:39
root / root
0644
Counter.pyi
0.283 KB
June 09 2025 11:12:39
root / root
0644
Padding.py
4.212 KB
June 09 2025 11:12:39
root / root
0644
Padding.pyi
0.232 KB
June 09 2025 11:12:39
root / root
0644
RFC1751.py
20.695 KB
June 09 2025 11:12:39
root / root
0644
RFC1751.pyi
0.155 KB
June 09 2025 11:12:39
root / root
0644
__init__.py
1.882 KB
June 09 2025 11:12:39
root / root
0644
_cpu_features.py
1.942 KB
June 09 2025 11:12:39
root / root
0644
_cpu_features.pyi
0.058 KB
June 09 2025 11:12:39
root / root
0644
_cpuid_c.abi3.so
15.328 KB
June 09 2025 11:13:05
root / root
0755
_file_system.py
2.12 KB
June 09 2025 11:12:39
root / root
0644
_file_system.pyi
0.098 KB
June 09 2025 11:12:39
root / root
0644
_raw_api.py
9.986 KB
June 09 2025 11:12:39
root / root
0644
_raw_api.pyi
0.885 KB
June 09 2025 11:12:39
root / root
0644
_strxor.abi3.so
15.32 KB
June 09 2025 11:13:05
root / root
0755
asn1.py
35.321 KB
June 09 2025 11:12:39
root / root
0644
asn1.pyi
3.716 KB
June 09 2025 11:12:39
root / root
0644
number.py
94.112 KB
June 09 2025 11:12:39
root / root
0644
number.pyi
0.952 KB
June 09 2025 11:12:39
root / root
0644
py3compat.py
5.396 KB
June 09 2025 11:12:39
root / root
0644
py3compat.pyi
0.817 KB
June 09 2025 11:12:39
root / root
0644
strxor.py
5.313 KB
June 09 2025 11:12:39
root / root
0644
strxor.pyi
0.237 KB
June 09 2025 11:12:39
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF