
    ,h                     p    d dl  d dlmZmZmZmZmZmZmZ  edd      Z	 G d de
      ZddZd	Zd
Zd Zy)    )*)load_pycryptodome_raw_libVoidPointerSmartPointercreate_string_bufferget_raw_bufferc_size_tc_uint8_ptrzCrypto.Hash._MD5a  
                        #define MD5_DIGEST_SIZE 16

                        int MD5_init(void **shaState);
                        int MD5_destroy(void *shaState);
                        int MD5_update(void *hs,
                                          const uint8_t *buf,
                                          size_t len);
                        int MD5_digest(const void *shaState,
                                          uint8_t digest[MD5_DIGEST_SIZE]);
                        int MD5_copy(const void *src, void *dst);

                        int MD5_pbkdf2_hmac_assist(const void *inner,
                                            const void *outer,
                                            const uint8_t first_digest[MD5_DIGEST_SIZE],
                                            uint8_t final_digest[MD5_DIGEST_SIZE],
                                            size_t iterations);
                        c                   D    e Zd ZdZdZdZdZddZd Zd Z	d	 Z
d
 ZddZy)MD5Hasha  A MD5 hash object.
    Do not instantiate directly.
    Use the :func:`new` function.

    :ivar oid: ASN.1 Object ID
    :vartype oid: string

    :ivar block_size: the size in bytes of the internal message block,
                      input to the compression function
    :vartype block_size: integer

    :ivar digest_size: the size in bytes of the resulting hash
    :vartype digest_size: integer
       @   z1.2.840.113549.2.5Nc                     t               }t        j                  |j                               }|rt	        d|z        t        |j                         t        j                        | _        |r| j                  |       y y )N Error %d while instantiating MD5)
r   _raw_md5_libMD5_init
address_of
ValueErrorr   getMD5_destroy_stateupdate)selfdatastateresults       Q/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/Crypto/Hash/MD5.py__init__zMD5Hash.__init__H   sn    &&u'7'7'9:?%& ' '"599;#/#;#;=KK     c           	          t         j                  | j                  j                         t	        |      t        t        |                  }|rt        d|z        y)zContinue hashing of a message by consuming the next chunk of data.

        Args:
            data (byte string/byte array/memoryview): The next chunk of the message being hashed.
        r   N)r   
MD5_updater   r   r
   r	   lenr   )r   r   r   s      r   r   zMD5Hash.updateS   sW     (():)4T):)1#d))<> ?%& ' ' r   c                     t        | j                        }t        j                  | j                  j                         |      }|rt        d|z        t        |      S )zReturn the **binary** (non-printable) digest of the message that has been hashed so far.

        :return: The hash digest, computed over the data processed so far.
                 Binary form.
        :rtype: byte string
        r   )r   digest_sizer   
MD5_digestr   r   r   r   )r   bfrr   s      r   digestzMD5Hash.digesta   s\     #4#3#34(():+.0?%& ' ' c""r   c           	      ~    dj                  | j                         D cg c]  }dt        |      z   c}      S c c}w )zReturn the **printable** digest of the message that has been hashed so far.

        :return: The hash digest, computed over the data processed so far.
                 Hexadecimal encoded.
        :rtype: string
         z%02x)joinr'   bord)r   xs     r   	hexdigestzMD5Hash.hexdigestr   s0     ww$++-@Qa(@AA@s   :c                     t               }t        j                  | j                  j	                         |j                  j	                               }|rt        d|z        |S )a4  Return 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
        zError %d while copying MD5)r   r   MD5_copyr   r   r   )r   cloner   s      r   copyzMD5Hash.copy|   sQ     	&&t{{'8).)9)9);=9FBCCr   c                     t        |      S )z!Create a fresh SHA-1 hash object.)r   )r   r   s     r   newzMD5Hash.new   s     t}r   N)__name__
__module____qualname____doc__r$   
block_sizeoidr   r   r'   r-   r1   r3    r   r   r   r   1   s7      KJ
C	'#"B$r   r   Nc                 4    t               j                  |       S )a  Create a new hash object.

    :parameter data:
        Optional. The very first chunk of the message to hash.
        It is equivalent to an early call to :meth:`MD5Hash.update`.
    :type data: byte string/byte array/memoryview

    :Return: A :class:`MD5Hash` hash object
    )r   r3   )r   s    r   r3   r3      s     9==r   r   r   c           	      0   t        |      t        k(  sJ |dkD  sJ t        t              }t        j	                  | j
                  j                         |j
                  j                         ||t        |            }|rt        d|z        t        |      S )z/Compute the expensive inner loop in PBKDF-HMAC.r   z'Error %d with PBKDF2-HMAC assis for MD5)
r"   r$   r   r   MD5_pbkdf2_hmac_assistr   r   r	   r   r   )innerouterfirst_digest
iterationsr&   r   s         r   _pbkdf2_hmac_assistrC      s     |++>
{
+C00LL$$&LL$$& Z(*F BVKLL#r   r4   )Crypto.Util.py3compatCrypto.Util._raw_apir   r   r   r   r   r	   r
   r   objectr   r3   r$   r9   rC   r;   r   r   <module>rG      sT   * $/ / / ));(`f `F
  
r   