Ë
    zñ�jÊ  ã                   óŒ   — d dl mZ d dlmZmZ d dl mZ dededefd„Z	ded	e
defd
„Zded	e
defd„Zdedefd„Zdededefd„Zy)é    N)ÚffiÚlib)ÚensureÚinp1Úinp2Úreturnc                 ó(  — t        t        | t        «      t        j                  ¬«       t        t        |t        «      t        j                  ¬«       t        t        | «      t        |«      «      }t        j                  d|«      }t        j                  d|«      }t        j                  || t        | «      «       t        j                  ||t        |«      «       t        | «      t        |«      k(  }t        j                  |||«      dk(  }|xr |S )zA
    Compare contents of two memory regions in constant time
    ©Úraisingzchar []r   )r   Ú
isinstanceÚbytesÚexcÚ	TypeErrorÚmaxÚlenr   ÚnewÚmemmover   Úsodium_memcmp)r   r   ÚlnÚbuf1Úbuf2ÚeqLÚeqCs          úT/var/www/api.ozpay.ru/ozpay/venv/lib/python3.12/site-packages/nacl/bindings/utils.pyr   r      s¿   € ô Œ:�dœEÓ"¬C¯M©MÕ:Ü
Œ:�dœEÓ"¬C¯M©MÕ:ä	ŒS�‹Yœ˜D›	Ó	"€Bä�7‰7�9˜bÓ!€DÜ�7‰7�9˜bÓ!€Dä‡K�K��dœC ›IÔ&Ü‡K�K��dœC ›IÔ&ä
ˆd‹)”s˜4“yÑ
 €CÜ
×
Ñ
˜D $¨Ó
+¨qÑ
0€CàŠ;�3Ðó    ÚsÚ	blocksizec                 ó  — t        t        | t        «      t        j                  ¬«       t        t        |t
        «      t        j                  ¬«       |dk  rt        j                  ‚t        | «      }||z   }t        j                  d|«      }t        j                  dd«      }t        j                  || |«       t        j                  |||||«      }t        |dk(  dt        j                  ¬«       t        j                  ||d   «      dd S )zþ
    Pad the input bytearray ``s`` to a multiple of ``blocksize``
    using the ISO/IEC 7816-4 algorithm

    :param s: input bytes string
    :type s: bytes
    :param blocksize:
    :type blocksize: int
    :return: padded string
    :rtype: bytes
    r
   r   úunsigned char []ú	size_t []é   zPadding failureN)r   r   r   r   r   ÚintÚ
ValueErrorr   r   r   r   r   Ú
sodium_padÚCryptoErrorÚbuffer)r   r   Ús_lenÚm_lenÚbufÚp_lenÚrcs          r   r$   r$   )   sÈ   € ô Œ:�aœÓ¬¯©Õ7Ü
Œ:�i¤Ó%¬s¯}©}Õ=Ø�A‚~Ü�n‰nÐÜ�‹F€EØ�IÑ€EÜ
�'‰'Ð$ eÓ
,€CÜ�G‰G�K Ó#€EÜ‡K�K��Q˜ÔÜ	�‰˜˜s E¨9°eÓ	<€BÜ
ˆ2�‰7Ð%¬s¯©Õ?Ü�:‰:�c˜5 ™8Ó$¡QÐ'Ð'r   c                 ó\  — t        t        | t        «      t        j                  ¬«       t        t        |t
        «      t        j                  ¬«       t        | «      }t        j                  dd«      }t        j                  || ||«      }|dk7  rt        j                  d«      ‚| d|d    S )zÚ
    Remove ISO/IEC 7816-4 padding from the input byte array ``s``

    :param s: input bytes string
    :type s: bytes
    :param blocksize:
    :type blocksize: int
    :return: unpadded string
    :rtype: bytes
    r
   r    r!   r   zUnpadding failureN)r   r   r   r   r   r"   r   r   r   r   Úsodium_unpadr%   )r   r   r'   Úu_lenr+   s        r   r-   r-   C   s„   € ô Œ:�aœÓ¬¯©Õ7Ü
Œ:�i¤Ó%¬s¯}©}Õ=Ü�‹F€EÜ�G‰G�K Ó#€EÜ	×	Ñ	˜%  E¨9Ó	5€BØ	ˆQ‚wÜ�o‰oÐ1Ó2Ð2ØˆZˆu�Q‰xˆ=Ðr   Úinpc                 ó"  — t        t        | t        «      t        j                  ¬«       t        | «      }t        j                  d|«      }t        j                  || |«       t        j                  ||«       t        j                  ||«      dd S )ag  
    Increment the value of a byte-sequence interpreted
    as the little-endian representation of a unsigned big integer.

    :param inp: input bytes buffer
    :type inp: bytes
    :return: a byte-sequence representing, as a little-endian
             unsigned big integer, the value ``to_int(inp)``
             incremented by one.
    :rtype: bytes

    r
   r   N)r   r   r   r   r   r   r   r   r   r   Úsodium_incrementr&   )r/   r   r)   s      r   r1   r1   X   si   € ô Œ:�cœ5Ó!¬3¯=©=Õ9ä	ˆS‹€BÜ
�'‰'Ð$ bÓ
)€Cä‡K�K��S˜"Ôä×Ñ˜˜bÔ!ä�:‰:�c˜2Ó™qÐ!Ð!r   ÚaÚbc                 ó  — t        t        | t        «      t        j                  ¬«       t        t        |t        «      t        j                  ¬«       t        | «      }t        t        |«      |k(  t        j                  ¬«       t        j                  d|«      }t        j                  d|«      }t        j                  || |«       t        j                  |||«       t        j                  |||«       t        j                  ||«      dd S )a  
    Given a couple of *same-sized* byte sequences, interpreted as the
    little-endian representation of two unsigned integers, compute
    the modular addition of the represented values, in constant time for
    a given common length of the byte sequences.

    :param a: input bytes buffer
    :type a: bytes
    :param b: input bytes buffer
    :type b: bytes
    :return: a byte-sequence representing, as a little-endian big integer,
             the integer value of ``(to_int(a) + to_int(b)) mod 2^(8*len(a))``
    :rtype: bytes
    r
   r   N)r   r   r   r   r   r   r   r   r   r   Ú
sodium_addr&   )r2   r3   r   Úbuf_aÚbuf_bs        r   r5   r5   q   sµ   € ô Œ:�aœÓ¬¯©Õ7Ü
Œ:�aœÓ¬¯©Õ7Ü	ˆQ‹€BÜ
Œ3ˆq‹6�R‰<¤§¡Õ/ä�G‰GÐ&¨Ó+€EÜ�G‰GÐ&¨Ó+€Eä‡K�K��q˜"ÔÜ‡K�K��q˜"Ôä‡N�N�5˜% Ô$ä�:‰:�e˜RÓ ¡Ð#Ð#r   )Únacl.exceptionsÚ
exceptionsr   Únacl._sodiumr   r   r   r   Úboolr   r"   r$   r-   r1   r5   © r   r   ú<module>r=      s‹   ðõ ß !Ý "ð˜ð  Uð ¨tó ð*(�%ð ( Cð (¨Eó (ð4�Eð  cð ¨eó ð*"˜%ð " Eó "ð2$�%ð $˜Eð $ eô $r   