
    ,h                         d dl mZ 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ej                  Zej                  Zy)
    )bord)load_pycryptodome_raw_libVoidPointerSmartPointercreate_string_bufferget_raw_bufferc_size_tc_uint8_ptrzCrypto.Hash._MD2a  
                        int md2_init(void **shaState);
                        int md2_destroy(void *shaState);
                        int md2_update(void *hs,
                                          const uint8_t *buf,
                                          size_t len);
                        int md2_digest(const void *shaState,
                                          uint8_t digest[20]);
                        int md2_copy(const void *src, void *dst);
                        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)MD2Hasha  An MD2 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.2Nc                     t               }t        j                  |j                               }|rt	        d|z        t        |j                         t        j                        | _        |r| j                  |       y y )N Error %d while instantiating MD2)
r   _raw_md2_libmd2_init
address_of
ValueErrorr   getmd2_destroy_stateupdate)selfdatastateresults       Q/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/Crypto/Hash/MD2.py__init__zMD2Hash.__init__K   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   
md2_updater   r   r
   r	   lenr   )r   r   r   s      r   r   zMD2Hash.updateV   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   
md2_digestr   r   r   r   )r   bfrr   s      r   digestzMD2Hash.digestd   s\     #4#3#34(():),.?%& ' ' 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&   r   )r   xs     r   	hexdigestzMD2Hash.hexdigestu   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 MD2)r   r   md2_copyr   r   r   )r   cloner   s      r   copyzMD2Hash.copy   sQ     	&&t{{'8',||'7'7'9;9FBCCr   c                     t        |      S N)r   )r   r   s     r   newzMD2Hash.new   s    t}r   r1   )__name__
__module____qualname____doc__r#   
block_sizeoidr   r   r&   r+   r/   r2    r   r   r   r   5   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:`MD2Hash.update`.
    :type data: bytes/bytearray/memoryview

    :Return: A :class:`MD2Hash` hash object
    )r   r2   )r   s    r   r2   r2      s     9==r   r1   )Crypto.Util.py3compatr   Crypto.Util._raw_apir   r   r   r   r   r	   r
   r   objectr   r2   r#   r7   r9   r   r   <module>r>      s[   > '/ / / )*	]f ]@ !! 
r   