Ë
    (üàg�  ã                   óP   — d dl mZmZmZ ddlmZ ddlmZmZ  G d„ de«      Z	d„ Z
y)	é    )ÚbordÚis_bytesÚtobytesé   )Ú	cSHAKE128)Ú_encode_strÚ_right_encodec                   ó.   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Zy)Ú	TupleHashz\A Tuple hash object.
    Do not instantiate directly.
    Use the :func:`new` function.
    c                 óP   — || _         |j                  d|d«      | _        d | _        y )Nó    s	   TupleHash)Údigest_sizeÚ_newÚ_cshakeÚ_digest)ÚselfÚcustomÚcshaker   s       úV/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/Crypto/Hash/TupleHash128.pyÚ__init__zTupleHash.__init__+   s%   € à&ˆÔà—{‘{ 3¨°Ó=ˆŒØˆ�r   c                 ó¶   — | j                   �t        d«      ‚|D ]<  }t        |«      st        d«      ‚| j                  j	                  t        |«      «       Œ> | S )zÜAuthenticate the next tuple of byte strings.
        TupleHash guarantees the logical separation between each byte string.

        Args:
            data (bytes/bytearray/memoryview): One or more items to hash.
        z6You cannot call 'update' after 'digest' or 'hexdigest'z#You can only call 'update' on bytes)r   Ú	TypeErrorr   r   Úupdater   )r   ÚdataÚitems      r   r   zTupleHash.update2   sZ   € ð �<‰<Ð#ÜÐTÓUÐUàò 	3ˆDÜ˜D”>ÜÐ EÓGÐGØ�L‰L×Ñ¤¨DÓ 1Õ2ð	3ð
 ˆr   c                 óè   — | j                   €[| j                  j                  t        | j                  dz  «      «       | j                  j                  | j                  «      | _         | j                   S )zŸReturn the **binary** (non-printable) digest of the tuple of byte strings.

        :return: The hash digest. Binary form.
        :rtype: byte string
        é   )r   r   r   r	   r   Úread)r   s    r   ÚdigestzTupleHash.digestD   sV   € ð �<‰<ÐØ�L‰L×Ñ¤¨d×.>Ñ.>ÀÑ.BÓ CÔDØŸ<™<×,Ñ,¨T×-=Ñ-=Ó>ˆDŒLà�|‰|Ðr   c           	      ó�   — dj                  t        | j                  «       «      D �cg c]  }dt        |«      z  ‘Œ c}«      S c c}w )z•Return the **printable** digest of the tuple of byte strings.

        :return: The hash digest. Hexadecimal encoded.
        :rtype: string
        Ú z%02x)ÚjoinÚtupler   r   )r   Úxs     r   Ú	hexdigestzTupleHash.hexdigestQ   s5   € ð �w‰w´%¸¿¹»Ó2FÖG¨Q˜¤ a£Ó(ÒGÓHÐHùÒGs   §Ac                 óF   — d|vrd|vr| j                   |d<   t        di |¤ŽS )zNReturn a new instance of a TupleHash object.
        See :func:`new`.
        Údigest_bytesÚdigest_bits© )r   Únew)r   Úkwargss     r   r*   zTupleHash.newZ   s/   € ð
  Ñ'¨MÀÑ,GØ%)×%5Ñ%5ˆF�>Ñ"ä‰}�V‰}Ðr   N)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r%   r*   r)   r   r   r   r   %   s!   „ ñò
òò$òIór   r   c                  ó  — | j                  dd«      }| j                  dd«      }d||fvrt        d«      ‚d||fk(  rd}|�|dk  r%t        d«      ‚|dk  s|dz  rt        d	«      ‚|dz  }| j                  d
d«      }t        |t        |«      S )aî  Create a new TupleHash128 object.

    Args:
       digest_bytes (integer):
        Optional. The size of the digest, in bytes.
        Default is 64. Minimum is 8.
       digest_bits (integer):
        Optional and alternative to ``digest_bytes``.
        The size of the digest, in bits (and in steps of 8).
        Default is 512. Minimum is 64.
       custom (bytes):
        Optional.
        A customization bytestring (``S`` in SP 800-185).

    :Return: A :class:`TupleHash` object
    r'   Nr(   z*Only one digest parameter must be provided)NNé@   r   z!'digest_bytes' must be at least 8z0'digest_bytes' must be at least 64 in steps of 8r   r   )Úpopr   Ú
ValueErrorr   r   )r+   r'   r(   r   s       r   r*   r*   e   s²   € ð$ —:‘:˜n¨dÓ3€LØ—*‘*˜]¨DÓ1€KØ�L +Ð.Ñ.ÜÐDÓEÐEØ˜ kÐ2Ò2ØˆØÐØ˜!ÒÜÐ@ÓAÐAà˜Ò˜{¨QšÜð -ó .ð .à" aÑ'ˆà�Z‰Z˜ #Ó&€Fä�VœY¨Ó5Ð5r   N)ÚCrypto.Util.py3compatr   r   r   r!   r   r   r	   Úobjectr   r*   r)   r   r   ú<module>r6      s%   ð÷> :Ñ 9å ß 1ô=�ô =ó@#6r   