
    ,h(                     r    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d	Zd
Zd Zy)    )bord)load_pycryptodome_raw_libVoidPointerSmartPointercreate_string_bufferget_raw_bufferc_size_tc_uint8_ptrzCrypto.Hash._SHA512a  
                        int SHA512_init(void **shaState,
                                        size_t digest_size);
                        int SHA512_destroy(void *shaState);
                        int SHA512_update(void *hs,
                                          const uint8_t *buf,
                                          size_t len);
                        int SHA512_digest(const void *shaState,
                                          uint8_t *digest,
                                          size_t digest_size);
                        int SHA512_copy(const void *src, void *dst);

                        int SHA512_pbkdf2_hmac_assist(const void *inner,
                                            const void *outer,
                                            const uint8_t *first_digest,
                                            uint8_t *final_digest,
                                            size_t iterations,
                                            size_t digest_size);
                        c                   :    e Zd ZdZdZd Zd Zd Zd Zd Z	d
d	Z
y)
SHA512Hasha  A SHA-512 hash object (possibly in its truncated version SHA-512/224 or
    SHA-512/256.
    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
       c                    || _         |d| _        d| _        n3|dk(  rd| _        d| _        n|dk(  rd| _        d| _        nt        d	      t	               }t
        j                  |j                         t        | j                              }|rt        d
|z        t        |j                         t
        j                        | _        |r| j                  |       y y )Nz2.16.840.1.101.3.4.2.3@   224z2.16.840.1.101.3.4.2.5   256z2.16.840.1.101.3.4.2.6    z7Incorrect truncation length. It must be '224' or '256'.z$Error %d while instantiating SHA-512)	_truncateoiddigest_size
ValueErrorr   _raw_sha512_libSHA512_init
address_ofr	   r   getSHA512_destroy_stateupdate)selfdatatruncatestateresults        T/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/Crypto/Hash/SHA512.py__init__zSHA512Hash.__init__E   s    !/DH!D/DH!D/DH!DVWW ,,U-=-=-?-5d6F6F-GIC%& ' '"599;#2#A#AC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.
        z'Error %d while hashing data with SHA512N)r   SHA512_updater   r   r
   r	   lenr   )r   r    r#   s      r$   r   zSHA512Hash.update_   sX     !..t{{/@/:4/@/7D	/BD F%& ' ' r&   c                     t        | j                        }t        j                  | j                  j                         |t        | 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
        z#Error %d while making SHA512 digest)	r   r   r   SHA512_digestr   r   r	   r   r   )r   bfrr#   s      r$   digestzSHA512Hash.digestm   sm     #4#3#34 ..t{{/@/2/78H8H/IK B%& ' ' 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SHA512Hash.hexdigest   s0     ww$++-@Qa(@AA@s   :c                     t        d| j                        }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
        NzError %d while copying SHA512)r   r   r   SHA512_copyr   r   r   )r   cloner#   s      r$   copyzSHA512Hash.copy   s[     40 ,,T[[__->-2\\-=-=-?A<vEFFr&   Nc                 .    t        || j                        S )z#Create a fresh SHA-512 hash object.)r   r   )r   r    s     r$   newzSHA512Hash.new   s     $//r&   )N)__name__
__module____qualname____doc__
block_sizer%   r   r-   r2   r6   r8    r&   r$   r   r   2   s-      J4'#$B$0r&   r   Nc                     t        | |      S )a  Create a new hash object.

    Args:
      data (bytes/bytearray/memoryview):
        Optional. The very first chunk of the message to hash.
        It is equivalent to an early call to :meth:`SHA512Hash.update`.
      truncate (string):
        Optional. The desired length of the digest. It can be either "224" or
        "256". If not present, the digest is 512 bits long.
        Passing this parameter is **not** equivalent to simply truncating
        the output digest.

    :Return: A :class:`SHA512Hash` hash object
    )r   )r    r!   s     r$   r8   r8      s      dH%%r&   r   r   c                 8   |dkD  sJ t        t        |            }t        j                  | j                  j                         |j                  j                         ||t        |      t        t        |                  }|rt        d|z        t        |      S )z/Compute the expensive inner loop in PBKDF-HMAC.r   z+Error %d with PBKDF2-HMAC assist for SHA512)	r   r)   r   SHA512_pbkdf2_hmac_assistr   r   r	   r   r   )innerouterfirst_digest
iterationsr,   r#   s         r$   _pbkdf2_hmac_assistrF      s     >
s<0
1C66LL$$&LL$$& Z(S./1F FOPP#r&   )NN)Crypto.Util.py3compatr   Crypto.Util._raw_apir   r   r   r   r   r	   r
   r   objectr   r8   r   r=   rF   r>   r&   r$   <module>rJ      sT   * '/ / / ,,A*l0 l0^&(  
r&   