
    ,h                     b    d dl mZ d dlmZmZmZmZmZmZm	Z	m
Z
 d dlmZ  G d de      ZddZy)	    )bord)load_pycryptodome_raw_libVoidPointerSmartPointercreate_string_bufferget_raw_bufferc_size_tc_uint8_ptrc_ubyte)_raw_keccak_libc                   0    e Zd ZdZdZddZd Zd ZddZy)	SHAKE128_XOFzA SHAKE128 hash object.
    Do not instantiate directly.
    Use the :func:`new` function.

    :ivar oid: ASN.1 Object ID
    :vartype oid: string
    z2.16.840.1.101.3.4.2.11Nc                 D   t               }t        j                  |j                         t	        d      t        d            }|rt        d|z        t        |j                         t        j                        | _
        d| _        d| _        |r| j                  |       y y )N       z%Error %d while instantiating SHAKE128F   )r   r   keccak_init
address_ofr	   r   
ValueErrorr   getkeccak_destroy_state_is_squeezing_paddingupdate)selfdatastateresults       V/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/Crypto/Hash/SHAKE128.py__init__zSHAKE128_XOF.__init__5   s     ,,U-=-=-?-5b\-4R[: D%& ' '"599;#2#A#AC"KK     c           	          | j                   rt        d      t        j                  | j                  j                         t        |      t        t        |                  }|rt        d|z        | S )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/You cannot call 'update' after the first 'read'z&Error %d while updating SHAKE128 state)
r   	TypeErrorr   keccak_absorbr   r   r
   r	   lenr   )r   r   r   s      r    r   zSHAKE128_XOF.updateD   sm     MNN ..t{{/@/:4/@/7D	/BD E%& ' 'r"   c                     d| _         t        |      }t        j                  | j                  j                         |t        |      t        | j                              }|rt        d|z        t        |      S )ah  
        Compute the next piece of XOF output.

        .. note::
            You cannot use :meth:`update` anymore after the first call to
            :meth:`read`.

        Args:
            length (integer): the amount of bytes this method must return

        :return: the next piece of XOF output (of the given length)
        :rtype: byte string
        Tz'Error %d while extracting from SHAKE128)r   r   r   keccak_squeezer   r   r	   r   r   r   r   )r   lengthbfrr   s       r    readzSHAKE128_XOF.readV   su     ""6* //0A03080@070FH F%& ' ' c""r"   c                 &     t        |       |      S )Nr   )type)r   r   s     r    newzSHAKE128_XOF.newq   s    tDzt$$r"   N)	__name__
__module____qualname____doc__oidr!   r   r+   r/    r"   r    r   r   )   s"     $C$#6%r"   r   Nc                     t        |       S )a  Return a fresh instance of a SHAKE128 object.

    Args:
       data (bytes/bytearray/memoryview):
        The very first chunk of the message to hash.
        It is equivalent to an early call to :meth:`update`.
        Optional.

    :Return: A :class:`SHAKE128_XOF` object
    r-   )r   r-   s    r    r/   r/   u   s     T""r"   r0   )Crypto.Util.py3compatr   Crypto.Util._raw_apir   r   r   r   r   r	   r
   r   Crypto.Hash.keccakr   objectr   r/   r6   r"   r    <module>r<      s2   > '8 8 8 /I%6 I%X#r"   