AlkantarClanX12

Your IP : 18.119.125.240


Current Path : /opt/imunify360/venv/lib64/python3.11/site-packages/Crypto/Hash/__pycache__/
Upload File :
Current File : //opt/imunify360/venv/lib64/python3.11/site-packages/Crypto/Hash/__pycache__/MD4.cpython-311.pyc

�

f��f����dZddlmZddlmZmZmZmZmZm	Z	m
Z
edd��ZGd�de��Z
d
d	�Ze
jZe
jZdS)a�
MD4 is specified in RFC1320_ and produces the 128 bit digest of a message.

    >>> from Crypto.Hash import MD4
    >>>
    >>> h = MD4.new()
    >>> h.update(b'Hello')
    >>> print h.hexdigest()

MD4 stand for Message Digest version 4, and it was invented by Rivest in 1990.
This algorithm is insecure. Do not use it for new designs.

.. _RFC1320: http://tools.ietf.org/html/rfc1320
���bord)�load_pycryptodome_raw_lib�VoidPointer�SmartPointer�create_string_buffer�get_raw_buffer�c_size_t�c_uint8_ptrzCrypto.Hash._MD4a�
                        int md4_init(void **shaState);
                        int md4_destroy(void *shaState);
                        int md4_update(void *hs,
                                          const uint8_t *buf,
                                          size_t len);
                        int md4_digest(const void *shaState,
                                          uint8_t digest[20]);
                        int md4_copy(const void *src, void *dst);
                        c�F�eZdZdZdZdZdZdd�Zd�Zd�Z	d	�Z
d
�Zdd�ZdS)
�MD4Hashz&Class that implements an MD4 hash
    ��@z1.2.840.113549.2.4Nc�6�t��}t�|�����}|rt	d|z���t|���tj��|_|r|�	|��dSdS)N� Error %d while instantiating MD4)
r�_raw_md4_lib�md4_init�
address_of�
ValueErrorr�get�md4_destroy�_state�update)�self�data�state�results    �q/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib64/python3.11/site-packages/Crypto/Hash/MD4.py�__init__zMD4Hash.__init__Os����
�
���&�&�u�'7�'7�'9�'9�:�:���	'��?�%�&�'�'�
'�"�5�9�9�;�;�#/�#;�=�=����	��K�K�������	�	�c	���t�|j���t	|��tt
|������}|rtd|z���dS)a�Continue hashing of a message by consuming the next chunk of data.

        Repeated calls are equivalent to a single call with the concatenation
        of all the arguments. In other words:

           >>> m.update(a); m.update(b)

        is equivalent to:

           >>> m.update(a+b)

        :Parameters:
          data : byte string/byte array/memoryview
            The next chunk of the message being hashed.
        rN)r�
md4_updaterrrr
�lenr)rrrs   rrzMD4Hash.updateZst��"�(�(�����):�):�)4�T�):�):�)1�#�d�)�)�)<�)<�>�>���	'��?�%�&�'�'�
'�	'�	'r c���t|j��}t�|j���|��}|rt
d|z���t|��S)arReturn the **binary** (non-printable) digest of the message that
        has been hashed so far.

        This method does not change the state of the hash object.
        You can continue updating the object after calling this function.

        :Return: A byte string of `digest_size` bytes. It may contain non-ASCII
         characters, including null bytes.
        r)r�digest_sizer�
md4_digestrrrr	)r�bfrrs   r�digestzMD4Hash.digestrso��#�4�#3�4�4���(�(�����):�):�),�.�.���	'��?�%�&�'�'�
'��c�"�"�"r c�d�d�d�|���D����S)aReturn the **printable** digest of the message that has been
        hashed so far.

        This method does not change the state of the hash object.

        :Return: A string of 2* `digest_size` characters. It contains only
         hexadecimal ASCII digits.
        �c�2�g|]}dt|��z��S)z%02xr)�.0�xs  r�
<listcomp>z%MD4Hash.hexdigest.<locals>.<listcomp>�s#��@�@�@�Q���a���(�@�@�@r )�joinr()rs r�	hexdigestzMD4Hash.hexdigest�s-���w�w�@�@�$�+�+�-�-�@�@�@�A�A�Ar c���t��}t�|j���|j�����}|rtd|z���|S)a4Return a copy ("clone") of the hash object.

        The copy will have the same internal state as the original hash
        object.
        This can be used to efficiently compute the digests of strings that
        share a common initial substring.

        :Return: A hash object of the same type
        zError %d while copying MD4)r
r�md4_copyrrr)r�cloners   r�copyzMD4Hash.copy�sc���	�	���&�&�t�{���'8�'8�',�|�'7�'7�'9�'9�;�;���	D��9�F�B�C�C�C��r c� �t|��S�N)r
)rrs  r�newzMD4Hash.new�s���t�}�}�r r6)
�__name__�
__module__�__qualname__�__doc__r%�
block_size�oidrrr(r0r4r7�r rr
r
Ds����������K��J�
�C�	�	�	�	�'�'�'�0#�#�#�(
B�
B�
B����$�����r r
Nc�D�t���|��S)aReturn a fresh instance of the hash object.

    :Parameters:
       data : byte string/byte array/memoryview
        The very first chunk of the message to hash.
        It is equivalent to an early call to `MD4Hash.update()`.
        Optional.

    :Return: A `MD4Hash` object
    )r
r7)rs rr7r7�s���9�9�=�=����r r6)r;�Crypto.Util.py3compatr�Crypto.Util._raw_apirrrrr	r
rr�objectr
r7r%r<r>r r�<module>rCs���>
�
�'�&�&�&�&�&�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�)�(�*�	����a�a�a�a�a�f�a�a�a�H�����!���
�
�
�
r