
    i$                     ~    S SK Jr  S SKJrJr  S SKJr  S SKJrJ	r	J
r
JrJrJrJr  \" SS5      r " S S\5      rS	 rg
)    )	unhexlify)bordtobytes)get_random_bytes)load_pycryptodome_raw_libVoidPointerSmartPointercreate_string_bufferget_raw_bufferc_size_tc_uint8_ptrzCrypto.Hash._BLAKE2ba  
                        int blake2b_init(void **state,
                                         const uint8_t *key,
                                         size_t key_size,
                                         size_t digest_size);
                        int blake2b_destroy(void *state);
                        int blake2b_update(void *state,
                                           const uint8_t *buf,
                                           size_t len);
                        int blake2b_digest(const void *state,
                                           uint8_t digest[64]);
                        int blake2b_copy(const void *src, void *dst);
                        c                   F    \ rS rSrSrSrS rS rS rS r	S r
S	 rS
 rSrg)BLAKE2b_Hash:   ar  A BLAKE2b 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
@   c           	         X0l         X@l        SU l        US;   a  U(       d  S[        U5      -   U l        [        5       n[        R                  UR                  5       [        U5      [        [        U5      5      [        U5      5      nU(       a  [        SU-  5      e[        UR                  5       [        R                  5      U l        U(       a  U R#                  U5        g g )NF)       0   r   z1.3.6.1.4.1.1722.12.2.1.z$Error %d while instantiating BLAKE2b)digest_size_update_after_digest_digest_donestroidr   _raw_blake2b_libblake2b_init
address_ofr   r   len
ValueErrorr	   getblake2b_destroy_stateupdate)selfdatakeydigest_bytesupdate_after_digeststateresults          N/var/www/html/trading/venv/lib/python3.13/site-packages/Crypto/Hash/BLAKE2b.py__init__BLAKE2b_Hash.__init__L   s     ($7!! ++C1C4EEDH!..u/?/?/A/:3/?/7C/A/7/E1
 CfLMM"599;#3#C#CEKK     c           	         U R                   (       a  U R                  (       d  [        S5      e[        R	                  U R
                  R                  5       [        U5      [        [        U5      5      5      nU(       a  [        SU-  5      eU $ )zContinue hashing of a message by consuming the next chunk of data.

Args:
    data (bytes/bytearray/memoryview): The next chunk of the message being hashed.
z8You can only call 'digest' or 'hexdigest' on this objectz#Error %d while hashing BLAKE2b data)r   r   	TypeErrorr   blake2b_updater"   r    r   r   r   r   )r$   r%   r*   s      r+   r#   BLAKE2b_Hash.updatef   sn     T%>%>VWW!001B1<T1B19#d)1DF BVKLLr.   c                     [        S5      n[        R                  U R                  R	                  5       U5      nU(       a  [        SU-  5      eSU l        [        U5      SU R                   $ )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   z&Error %d while creating BLAKE2b digestTN)	r
   r   blake2b_digestr"   r    r   r   r   r   )r$   bfrr*   s      r+   digestBLAKE2b_Hash.digestx   sc     #2&!001B146ENOO c"#4D$4$455r.   c           	          SR                  [        U R                  5       5       Vs/ s H  nS[        U5      -  PM     sn5      $ s  snf )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)jointupler6   r   )r$   xs     r+   	hexdigestBLAKE2b_Hash.hexdigest   s;     ww%2FG2FQa(2FGHHGs   Ac                     [        S5      n[        SX!S9n[        SX R                  5       S9nUR                  5       UR                  5       :w  a  [        S5      eg)a(  Verify that a given **binary** MAC (computed by another party)
is valid.

Args:
  mac_tag (bytes/bytearray/memoryview): the expected MAC of the message.

Raises:
    ValueError: if the MAC does not match. It means that the message
        has been tampered with or that the MAC key is incorrect.
      )digest_bitsr&   r%   zMAC check failedN)r   newr6   r   )r$   mac_tagsecretmac1mac2s        r+   verifyBLAKE2b_Hash.verify   sQ     ""%s=s[[]C;;=DKKM)/00 *r.   c                 J    U R                  [        [        U5      5      5        g)a6  Verify that a given **printable** MAC (computed by another party)
is valid.

Args:
    hex_mac_tag (string): the expected MAC of the message, as a hexadecimal string.

Raises:
    ValueError: if the MAC does not match. It means that the message
        has been tampered with or that the MAC key is incorrect.
N)rH   r   r   )r$   hex_mac_tags     r+   	hexverifyBLAKE2b_Hash.hexverify   s     	Igk234r.   c                 N    SU;  a  SU;  a  U R                   US'   [        S0 UD6$ )zAReturn a new instance of a BLAKE2b hash object.
See :func:`new`.
r'   rB    )r   rC   )r$   kwargss     r+   rC   BLAKE2b_Hash.new   s/    
 'M,G%)%5%5F>"}V}r.   )r   r"   r   r   r   N)__name__
__module____qualname____firstlineno____doc__
block_sizer,   r#   r6   r=   rH   rL   rC   __static_attributes__rO   r.   r+   r   r   :   s2     J4$6&I1*5r.   r   c                     U R                  SS5      nU R                  SS5      nU R                  SS5      nU R                  SS5      nSX44;  a  [        S5      eSX44:X  a  S	nUb  S
Us=::  a  S	::  d  O  [        S5      eO*SUs=::  a  S::  a  O  O
US-  (       a  [        S5      eUS-  nU R                  SS5      n[        U5      S	:  a  [        S5      eU (       a  [        S[	        U 5      -   5      e[        XX25      $ )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:`BLAKE2b_Hash.update`.
    digest_bytes (integer):
        Optional. The size of the digest, in bytes (1 to 64). Default is 64.
    digest_bits (integer):
        Optional and alternative to ``digest_bytes``.
        The size of the digest, in bits (8 to 512, in steps of 8).
        Default is 512.
    key (bytes/bytearray/memoryview):
        Optional. The key to use to compute the MAC (1 to 64 bytes).
        If not specified, no key will be used.
    update_after_digest (boolean):
        Optional. By default, a hash object cannot be updated anymore after
        the digest is computed. When this flag is ``True``, such check
        is no longer enforced.

Returns:
    A :class:`BLAKE2b_Hash` hash object
r%   Nr(   Fr'   rB   z*Only one digest parameter must be provided)NNr      z!'digest_bytes' not in range 1..64   i   z2'digest_bits' not in range 8..512, with steps of 8r&   r.   z"BLAKE2b key cannot exceed 64 byteszUnknown parameters: )popr0   r   r   r   r   )rP   r%   r(   r'   rB   r&   s         r+   rC   rC      s   2 ::fd#D **%:EB::nd3L**]D1KL..DEE22\'R'@AA ( ['C'[1_ / 0 0"a'
**UC
 C
3x"}=>>.V<==<EEr.   N)binasciir   Crypto.Util.py3compatr   r   Crypto.Randomr   Crypto.Util._raw_apir   r   r	   r
   r   r   r   r   objectr   rC   rO   r.   r+   <module>rb      sI   >  / */ / / --C  H6 HV2Fr.   