HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //proc/thread-self/root/lib/python3/dist-packages/nacl/__pycache__/hash.cpython-38.pyc
U

�֫[(�@sdZddlmZmZmZddlZddlZejj	Z
ejjZejj
ZejjZejjZejjZejjZejjZejjZejjZejjZejjZ ejj!Z"ejj#Z$ejj%Z&ej'j(fdd�Z)ej'j(fdd�Z*e
dddej'j(fd	d
�Z+e+Z,dej'j(fdd�Z-e-Z.dej'j(fd
d�Z/dS)z�
The :mod:`nacl.hash` module exposes one-shot interfaces
for libsodium selected hash primitives and the constants needed
for their usage.
�)�absolute_import�division�print_functionNcCs|�tj�|��S)z�
    Hashes ``message`` with SHA256.

    :param message: The message to hash.
    :type message: bytes
    :param encoder: A class that is able to encode the hashed message.
    :returns: The hashed message.
    :rtype: bytes
    )�encode�nacl�bindingsZcrypto_hash_sha256��message�encoder�r�+/usr/lib/python3/dist-packages/nacl/hash.py�sha256<s
r
cCs|�tj�|��S)z�
    Hashes ``message`` with SHA512.

    :param message: The message to hash.
    :type message: bytes
    :param encoder: A class that is able to encode the hashed message.
    :returns: The hashed message.
    :rtype: bytes
    )rrrZcrypto_hash_sha512rrrr�sha512Is
r�cCst|||||d�}|�|�S)a�
    Hashes ``data`` with blake2b.

    :param data: the digest input byte sequence
    :type data: bytes
    :param digest_size: the requested digest size; must be at most
                        :const:`BLAKE2B_BYTES_MAX`;
                        the default digest size is
                        :const:`BLAKE2B_BYTES`
    :type digest_size: int
    :param key: the key to be set for keyed MAC/PRF usage; if set, the key
                must be at most :data:`~nacl.hash.BLAKE2B_KEYBYTES_MAX` long
    :type key: bytes
    :param salt: an initialization salt at most
                 :const:`BLAKE2B_SALTBYTES` long;
                 it will be zero-padded if needed
    :type salt: bytes
    :param person: a personalization string at most
                   :const:`BLAKE2B_PERSONALBYTES` long;
                   it will be zero-padded if needed
    :type person: bytes
    :param encoder: the encoder to use on returned digest
    :type encoder: class
    :returns: The hashed message.
    :rtype: bytes
    )�digest_size�key�salt�person)�	_b2b_hashr)�datarrrrr
�digestrrr�blake2bVs
�rcCst||�}|�|�S)a�
    Computes a keyed MAC of ``message`` using the short-input-optimized
    siphash-2-4 construction.

    :param message: The message to hash.
    :type message: bytes
    :param key: the message authentication key for the siphash MAC construct
    :type key: bytes(:const:`SIPHASH_KEYBYTES`)
    :param encoder: A class that is able to encode the hashed message.
    :returns: The hashed message.
    :rtype: bytes(:const:`SIPHASH_BYTES`)
    )�	_sip_hashr�r	rr
rrrr�	siphash24|s
rcCst||�}|�|�S)a�
    Computes a keyed MAC of ``message`` using the 128 bit variant of the
    siphash-2-4 construction.

    :param message: The message to hash.
    :type message: bytes
    :param key: the message authentication key for the siphash MAC construct
    :type key: bytes(:const:`SIPHASHX_KEYBYTES`)
    :param encoder: A class that is able to encode the hashed message.
    :returns: The hashed message.
    :rtype: bytes(:const:`SIPHASHX_BYTES`)

    .. versionadded:: 1.2
    )�
_sip_hashxrrrrr�
siphashx24�s
r)0�__doc__Z
__future__rrrZ
nacl.bindingsrZ
nacl.encodingrZcrypto_generichash_BYTESZ
BLAKE2B_BYTESZcrypto_generichash_BYTES_MINZBLAKE2B_BYTES_MINZcrypto_generichash_BYTES_MAXZBLAKE2B_BYTES_MAXZcrypto_generichash_KEYBYTESZBLAKE2B_KEYBYTESZcrypto_generichash_KEYBYTES_MINZBLAKE2B_KEYBYTES_MINZcrypto_generichash_KEYBYTES_MAXZBLAKE2B_KEYBYTES_MAXZcrypto_generichash_SALTBYTESZBLAKE2B_SALTBYTESZ crypto_generichash_PERSONALBYTESZBLAKE2B_PERSONALBYTESZ crypto_shorthash_siphash24_BYTESZ
SIPHASH_BYTESZ#crypto_shorthash_siphash24_KEYBYTESZSIPHASH_KEYBYTESZ!crypto_shorthash_siphashx24_BYTESZSIPHASHX_BYTESZ$crypto_shorthash_siphashx24_KEYBYTESZSIPHASHX_KEYBYTESZ(crypto_generichash_blake2b_salt_personalrZcrypto_shorthash_siphash24rZcrypto_shorthash_siphashx24r�encodingZ
HexEncoderr
rrZgenerichashrZ	shorthashrrrrr�<module>s:

�
#