Ë
    zñ�j”"  ã                   óŠ  — U d dl mZmZ d dlmZ d dlmZmZ d dl	m
Z
  ej                  «       Zeed<    ej                  «       Zeed<    ej"                  «       Zeed<    ej&                  «       Zeed<    ej*                  «       Zeed	<    ej.                  «       Zeed
<    ej2                  «       Zeed<    ej6                  «       Zeed<    ej:                  «       Zeed<   dZdZ dede!de!de!ddf
d„Z"edddfde!dede!de!de!de!fd„Z# edd¬«      Z$ G d„ d«      Z%dddefde!de!de!dede%f
d„Z&de%de!ddfd „Z'de%de!fd!„Z(y)"é    )ÚNoReturnÚTypeVar)Ú
exceptions)ÚffiÚlib)ÚensureÚcrypto_generichash_BYTESÚcrypto_generichash_BYTES_MINÚcrypto_generichash_BYTES_MAXÚcrypto_generichash_KEYBYTESÚcrypto_generichash_KEYBYTES_MINÚcrypto_generichash_KEYBYTES_MAXÚcrypto_generichash_SALTBYTESÚ crypto_generichash_PERSONALBYTESÚcrypto_generichash_STATEBYTESz!{0} length greater than {1} bytesz{0} greater than {1}Údigest_sizeÚkeyÚsaltÚpersonÚreturnNc                 ób  — t        t        |t        «      dt        j                  ¬«       t        t        |t        «      dt        j                  ¬«       t        t        |t        «      dt        j                  ¬«       t        t        | t
        «      dt        j                  ¬«       t        | t        k  t        j                  dt        «      t        j                  ¬«       t        t        |«      t        k  t        j                  dt        «      t        j                  ¬«       t        t        |«      t        k  t        j                  dt        «      t        j                  ¬«       t        t        |«      t        k  t        j                  d	t        «      t        j                  ¬«       y
)zCheck hash parameterszKey must be a bytes sequence©ÚraisingzSalt must be a bytes sequencezPerson must be a bytes sequencez%Digest size must be an integer numberÚDigest_sizeÚKeyÚSaltÚPersonN)r   Ú
isinstanceÚbytesÚexcÚ	TypeErrorÚintr   Ú_TOOBIGÚformatÚ
ValueErrorÚlenr   Ú	_OVERLONGr   r   )r   r   r   r   s       úa/var/www/api.ozpay.ru/ozpay/venv/lib/python3.12/site-packages/nacl/bindings/crypto_generichash.pyÚ_checkparamsr)   )   s0  € ô Ü�3œÓØ&Ü—‘õô Ü�4œÓØ'Ü—‘õô Ü�6œ5Ó!Ø)Ü—‘õô Ü�;¤Ó$Ø/Ü—‘õô ØÔ3Ñ3Ü�‰�}Ô&BÓCÜ—‘õô ÜˆC‹Ô3Ñ3Ü×Ñ˜Ô ?Ó@Ü—‘õô ÜˆD‹	Ô1Ñ1Ü×Ñ˜Ô!=Ó>Ü—‘õô ÜˆF‹Ô7Ñ7Ü×Ñ˜Ô#CÓDÜ—‘öó    r*   Údatac           
      óR  — t        ||||«       t        t        | t        «      dt        j
                  ¬«       t        j                  d|«      }t        j                  dt        «      }t        j                  dt        «      }t        j                  ||t        |«      «       t        j                  ||t        |«      «       t        j                  ||| t        | «      |t        |«      ||«      }t        |dk(  dt        j                  ¬«       t        j                  ||«      dd S )ab  One shot hash interface

    :param data: the input data to the hash function
    :type data: bytes
    :param digest_size: must be at most
                        :py:data:`.crypto_generichash_BYTES_MAX`;
                        the default digest size is
                        :py:data:`.crypto_generichash_BYTES`
    :type digest_size: int
    :param key: must be at most
                :py:data:`.crypto_generichash_KEYBYTES_MAX` long
    :type key: bytes
    :param salt: must be at most
                 :py:data:`.crypto_generichash_SALTBYTES` long;
                 will be zero-padded if needed
    :type salt: bytes
    :param person: must be at most
                   :py:data:`.crypto_generichash_PERSONALBYTES` long:
                   will be zero-padded if needed
    :type person: bytes
    :return: digest_size long digest
    :rtype: bytes
    ú#Input data must be a bytes sequencer   úunsigned char[]úunsigned char []r   úUnexpected failureN)r)   r   r   r   r    r!   r   Únewr   r   Úmemmover&   r   Ú(crypto_generichash_blake2b_salt_personalÚRuntimeErrorÚbuffer)	r+   r   r   r   r   ÚdigestÚ_saltÚ_personÚrcs	            r(   Ú!generichash_blake2b_salt_personalr:   ^   sç   € ô> �˜c 4¨Ô0ä
Ü�4œÓØ-Ü—‘õô �W‰WÐ&¨Ó4€Fô �G‰GÐ&Ô(DÓE€EÜ�g‰gÐ(Ô*JÓK€Gä‡K�K��tœS ›YÔ'Ü‡K�K�˜¤ V£Ô-ä	×	5Ñ	5Ø�˜T¤3 t£9¨c´3°s³8¸UÀGó
€Bô ˆ2�‰7Ð(´#×2BÑ2BÕCä�:‰:�f˜kÓ*©1Ð-Ð-r*   Ú_Blake2StateÚBlake2State)Úboundc                   ó@   — e Zd ZdZddgZdefd„Zdefd„Zde	de	fd„Z
y	)
r<   zN
    Python-level wrapper for the crypto_generichash_blake2b state buffer
    Ú	_statebufr   c                 óP   — t        j                  dt        «      | _        || _        y )Nr.   )r   r1   r   r?   r   )Úselfr   s     r(   Ú__init__zBlake2State.__init__    s"   € ÜŸ™ØÔ<ó
ˆŒð 'ˆÕr*   r   c                 ó^   — t        dj                  | j                  j                  «      «      ‚)zc
        Raise the same exception as hashlib's blake implementation
        on copy.copy()
        zcan't pickle {} objects)r!   r$   Ú	__class__Ú__name__)rA   s    r(   Ú
__reduce__zBlake2State.__reduce__¦   s)   € ô
 Ø%×,Ñ,¨T¯^©^×-DÑ-DÓEó
ð 	
r*   rA   c                 óš   — | j                  | j                  «      }t        j                  |j                  | j                  t
        «       |S )N)rD   r   r   r2   r?   r   )rA   Ú_sts     r(   ÚcopyzBlake2State.copy¯   s9   € Ø�n‰n˜T×-Ñ-Ó.ˆÜ�‰Ø�M‰M˜4Ÿ>™>Ô+Hô	
ð ˆ
r*   N)rE   Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__r"   rB   r   rF   r;   rI   © r*   r(   r<   r<   ™   s>   „ ñð ˜mÐ,€Ið' Có 'ð
˜Hó 
ð�<ð  Lô r*   c                 ó¸  — t        || ||«       t        |«      }t        j                  dt        «      }t        j                  dt
        «      }t        j                  ||t        |«      «       t        j                  ||t        |«      «       t        j                  |j                  | t        | «      |||«      }t        |dk(  dt        j                  ¬«       |S )a@  
    Create a new initialized blake2b hash state

    :param key: must be at most
                :py:data:`.crypto_generichash_KEYBYTES_MAX` long
    :type key: bytes
    :param salt: must be at most
                 :py:data:`.crypto_generichash_SALTBYTES` long;
                 will be zero-padded if needed
    :type salt: bytes
    :param person: must be at most
                   :py:data:`.crypto_generichash_PERSONALBYTES` long:
                   will be zero-padded if needed
    :type person: bytes
    :param digest_size: must be at most
                        :py:data:`.crypto_generichash_BYTES_MAX`;
                        the default digest size is
                        :py:data:`.crypto_generichash_BYTES`
    :type digest_size: int
    :return: a initialized :py:class:`.Blake2State`
    :rtype: object
    r/   r   r0   r   )r)   r<   r   r1   r   r   r2   r&   r   Ú-crypto_generichash_blake2b_init_salt_personalr?   r   r    r4   )r   r   r   r   Ústater7   r8   r9   s           r(   Úgenerichash_blake2b_initrR   ·   s­   € ô: �˜c 4¨Ô0ä˜Ó$€Eô �G‰GÐ&Ô(DÓE€EÜ�g‰gÐ(Ô*JÓK€Gä‡K�K��tœS ›YÔ'Ü‡K�K�˜¤ V£Ô-ä	×	:Ñ	:Ø�‰˜œc #›h¨°U¸Gó
€Bô ˆ2�‰7Ð(´#×2BÑ2BÕCà€Lr*   rQ   c                 ó>  — t        t        | t        «      dt        j                  ¬«       t        t        |t
        «      dt        j                  ¬«       t        j                  | j                  |t        |«      «      }t        |dk(  dt        j                  ¬«       y)zúUpdate the blake2b hash state

    :param state: a initialized Blake2bState object as returned from
                     :py:func:`.crypto_generichash_blake2b_init`
    :type state: :py:class:`.Blake2State`
    :param data:
    :type data: bytes
    ú"State must be a Blake2State objectr   r-   r   r0   N)r   r   r<   r    r!   r   r   Ú!crypto_generichash_blake2b_updater?   r&   r4   )rQ   r+   r9   s      r(   Úgenerichash_blake2b_updaterV   ç   sx   € ô Ü�5œ+Ó&Ø,Ü—‘õô Ü�4œÓØ-Ü—‘õô 
×	.Ñ	.Ø�‰˜œs 4›yó
€Bô ˆ2�‰7Ð(´#×2BÑ2BÖCr*   c                 ód  — t        t        | t        «      dt        j                  ¬«       t        j                  dt        «      }t        j                  | j                  || j                  «      }t        |dk(  dt        j                  ¬«       t        j                  || j                  «      dd S )a:  Finalize the blake2b hash state and return the digest.

    :param state: a initialized Blake2bState object as returned from
                     :py:func:`.crypto_generichash_blake2b_init`
    :type state: :py:class:`.Blake2State`
    :return: the blake2 digest of the passed-in data stream
    :rtype: bytes
    rT   r   r.   r   r0   N)r   r   r<   r    r!   r   r1   r   r   Ú crypto_generichash_blake2b_finalr?   r   r4   r5   )rQ   Ú_digestr9   s      r(   Úgenerichash_blake2b_finalrZ     sŠ   € ô Ü�5œ+Ó&Ø,Ü—‘õô �g‰gÐ'Ô)EÓF€GÜ	×	-Ñ	-Ø�‰˜ %×"3Ñ"3ó
€Bô ˆ2�‰7Ð(´#×2BÑ2BÕCÜ�:‰:�g˜u×0Ñ0Ó1±!Ð4Ð4r*   ))Útypingr   r   Únaclr   r    Únacl._sodiumr   r   Únacl.exceptionsr   Ú crypto_generichash_blake2b_bytesr	   r"   Ú__annotations__Ú$crypto_generichash_blake2b_bytes_minr
   Ú$crypto_generichash_blake2b_bytes_maxr   Ú#crypto_generichash_blake2b_keybytesr   Ú'crypto_generichash_blake2b_keybytes_minr   Ú'crypto_generichash_blake2b_keybytes_maxr   Ú$crypto_generichash_blake2b_saltbytesr   Ú(crypto_generichash_blake2b_personalbytesr   Úcrypto_generichash_statebytesr   r'   r#   r   r)   r:   r;   r<   rR   rV   rZ   rN   r*   r(   ú<module>ri      s  ð÷ %Ð $å "ß !Ý "ð !E × DÑ DÓ FÐ ˜#Ó FØ$L C×$LÑ$LÓ$NÐ ˜cÓ NØ$L C×$LÑ$LÓ$NÐ ˜cÓ NØ#J 3×#JÑ#JÓ#LÐ ˜SÓ Là/€C×/Ñ/Ó1ð   ó ð 0€C×/Ñ/Ó1ð   ó ð %M C×$LÑ$LÓ$NÐ ˜cÓ Nà0€C×0Ñ0Ó2ð ! #ó ð &G S×%FÑ%FÓ%HÐ ˜sÓ Hà/€	Ø
 €ð2Øð2Ø ð2Ø(-ð2Ø7<ð2à	ó2ðn 0ØØØñ5.Ø
ð5.àð5.ð 
ð5.ð ð	5.ð
 ð5.ð ó5.ñp �~¨]Ô;€÷ñ ð> ØØØ/ñ	-Ø	ð-à
ð-ð ð-ð ð	-ð
 ó-ð`D kð D¸ð DÀ4ó Dð85 [ð 5°Uô 5r*   