§
    ‹r°dŠ  ã                   óœ   — d dl mZ d dlmZmZmZ d dlmZ d dlm	Z	 d dl
mZmZmZmZmZmZmZ  edd¦  «        Z G d„ d	e¦  «        Zd
„ ZdS )é    )Ú	unhexlify)ÚbordÚtobytesÚ_copy_bytes)ÚBLAKE2s)Úget_random_bytes)Úload_pycryptodome_raw_libÚVoidPointerÚSmartPointerÚcreate_string_bufferÚget_raw_bufferÚc_size_tÚc_uint8_ptrzCrypto.Hash._poly1305aÛ  
                        int poly1305_init(void **state,
                                          const uint8_t *r,
                                          size_t r_len,
                                          const uint8_t *s,
                                          size_t s_len);
                        int poly1305_destroy(void *state);
                        int poly1305_update(void *state,
                                            const uint8_t *in,
                                            size_t len);
                        int poly1305_digest(const void *state,
                                            uint8_t *digest,
                                            size_t len);
                        c                   ó@   — e Zd ZdZdZd„ Zd„ Zd„ Zd„ Zd„ Z	d„ Z
d	„ Zd
S )ÚPoly1305_MACzÀAn Poly1305 MAC object.
    Do not instantiate directly. Use the :func:`new` function.

    :ivar digest_size: the size in bytes of the resulting MAC tag
    :vartype digest_size: integer
    é   c                 óp  — t          |¦  «        dk    rt          d¦  «        ‚t          |¦  «        dk    rt          d¦  «        ‚d | _        t          ¦   «         }t                               |                     ¦   «         t          |¦  «        t          t          |¦  «        ¦  «        t          |¦  «        t          t          |¦  «        ¦  «        ¦  «        }|rt          d|z  ¦  «        ‚t          | 
                    ¦   «         t          j        ¦  «        | _        |r|                      |¦  «         d S d S )Nr   z Parameter r is not 16 bytes longz Parameter s is not 16 bytes longz%Error %d while instantiating Poly1305)ÚlenÚ
ValueErrorÚ_mac_tagr
   Ú_raw_poly1305Úpoly1305_initÚ
address_ofr   r   r   ÚgetÚpoly1305_destroyÚ_stateÚupdate)ÚselfÚrÚsÚdataÚstateÚresults         úY/var/www/pp.vulcan-creative.com/venv/lib/python3.11/site-packages/Crypto/Hash/Poly1305.pyÚ__init__zPoly1305_MAC.__init__?   s  € åˆq‰6Œ6�RŠ<ˆ<ÝÐ?Ñ@Ô@Ð@Ýˆq‰6Œ6�RŠ<ˆ<ÝÐ?Ñ@Ô@Ð@àˆŒå‘”ˆÝ×,Ò,¨U×-=Ò-=Ñ-?Ô-?Ý-8¸©^¬^Ý-5µc¸!±f´fÑ-=Ô-=Ý-8¸©^¬^Ý-5µc¸!±f´fÑ-=Ô-=ñ	/ô /ˆð ð 	OÝÐDÀvÑMÑNÔNÐNÝ" 5§9¢9¡;¤;Ý#0Ô#AñCô CˆŒàð 	Ø�KŠK˜ÑÔÐÐÐð	ð 	ó    c           	      ó  — | j         rt          d¦  «        ‚t                               | j                             ¦   «         t          |¦  «        t          t          |¦  «        ¦  «        ¦  «        }|rt          d|z  ¦  «        ‚| S )zŒAuthenticate the next chunk of message.

        Args:
            data (byte string/byte array/memoryview): The next chunk of data
        z8You can only call 'digest' or 'hexdigest' on this objectz$Error %d while hashing Poly1305 data)
r   Ú	TypeErrorr   Úpoly1305_updater   r   r   r   r   r   )r   r!   r#   s      r$   r   zPoly1305_MAC.updateV   sƒ   € ð Œ=ð 	XÝÐVÑWÔWÐWå×.Ò.¨t¬{¯ªÑ/@Ô/@Ý/:¸4Ñ/@Ô/@Ý/7½¸D¹	¼	Ñ/BÔ/BñDô Dˆð ð 	NÝÐCÀfÑLÑMÔMÐMØˆr&   c                 ó   — t          ¦   «         ‚)N)ÚNotImplementedError©r   s    r$   ÚcopyzPoly1305_MAC.copyg   s   € Ý!Ñ#Ô#Ð#r&   c           	      ó4  — | j         r| j         S t          d¦  «        }t                               | j                             ¦   «         |t          t          |¦  «        ¦  «        ¦  «        }|rt          d|z  ¦  «        ‚t          |¦  «        | _         | j         S )zìReturn the **binary** (non-printable) MAC tag of the message
        authenticated so far.

        :return: The MAC tag digest, computed over the data processed so far.
                 Binary form.
        :rtype: byte string
        r   z'Error %d while creating Poly1305 digest)
r   r   r   Úpoly1305_digestr   r   r   r   r   r   )r   Úbfrr#   s      r$   ÚdigestzPoly1305_MAC.digestj   s’   € ð Œ=ð 	!Ø”=Ð å" 2Ñ&Ô&ˆÝ×.Ò.¨t¬{¯ªÑ/@Ô/@Ø/2Ý/7½¸C¹¼Ñ/AÔ/AñCô Cˆð ð 	QÝÐFÈÑOÑPÔPÐPå& sÑ+Ô+ˆŒØŒ}Ðr&   c                 ó~   — d                      d„ t          |                      ¦   «         ¦  «        D ¦   «         ¦  «        S )zÓReturn the **printable** MAC tag of the message authenticated so far.

        :return: The MAC tag, computed over the data processed so far.
                 Hexadecimal encoded.
        :rtype: string
        Ú c                 ó2   — g | ]}d t          |¦  «        z  ‘ŒS )z%02x)r   )Ú.0Úxs     r$   ú
<listcomp>z*Poly1305_MAC.hexdigest.<locals>.<listcomp>ˆ   s3   € ð 7ð 7ð 7Øð ¥ a¡¤Ñ(ð 7ð 7ð 7r&   )ÚjoinÚtupler1   r,   s    r$   Ú	hexdigestzPoly1305_MAC.hexdigest€   sF   € ð �wŠwð 7ð 7Ý!& t§{¢{¡}¤}Ñ!5Ô!5ð7ñ 7ô 7ñ 8ô 8ð 	8r&   c                 ó  — t          d¦  «        }t          j        d||¬¦  «        }t          j        d||                      ¦   «         ¬¦  «        }|                     ¦   «         |                     ¦   «         k    rt	          d¦  «        ‚dS )ah  Verify that a given **binary** MAC (computed by another party)
        is valid.

        Args:
          mac_tag (byte string/byte string/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.
        r   é    )Údigest_bitsÚkeyr!   zMAC check failedN)r   r   Únewr1   r   )r   Úmac_tagÚsecretÚmac1Úmac2s        r$   ÚverifyzPoly1305_MAC.verify‹   sw   € õ " "Ñ%Ô%ˆåŒ{ s°¸WÐEÑEÔEˆÝŒ{ s°¸T¿[º[¹]¼]ÐKÑKÔKˆà�;Š;‰=Œ=˜DŸKšK™MœMÒ)Ð)ÝÐ/Ñ0Ô0Ð0ð *Ð)r&   c                 ód   — |                       t          t          |¦  «        ¦  «        ¦  «         dS )a~  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)rD   r   r   )r   Úhex_mac_tags     r$   Ú	hexverifyzPoly1305_MAC.hexverifyŸ   s,   € ð 	�Š•I�g kÑ2Ô2Ñ3Ô3Ñ4Ô4Ð4Ð4Ð4r&   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Údigest_sizer%   r   r-   r1   r:   rD   rG   © r&   r$   r   r   5   sŽ   € € € € € ðð ð €Kðð ð ð.ð ð ð"$ð $ð $ðð ð ð,	8ð 	8ð 	8ð1ð 1ð 1ð(5ð 5ð 5ð 5ð 5r&   r   c                  óÚ  — |                       dd¦  «        }t          |d¦  «        st          d¦  «        ‚|                       dd¦  «        }|€t          d¦  «        ‚|                       dd¦  «        }|                       dd¦  «        }| rt          d	t	          | ¦  «        z   ¦  «        ‚|                     ||¦  «        \  }}}t          |||¦  «        }t          dd|¦  «        |_        |S )
a°  Create a new Poly1305 MAC object.

    Args:
        key (bytes/bytearray/memoryview):
            The 32-byte key for the Poly1305 object.
        cipher (module from ``Crypto.Cipher``):
            The cipher algorithm to use for deriving the Poly1305
            key pair *(r, s)*.
            It can only be ``Crypto.Cipher.AES`` or ``Crypto.Cipher.ChaCha20``.
        nonce (bytes/bytearray/memoryview):
            Optional. The non-repeatable value to use for the MAC of this message.
            It must be 16 bytes long for ``AES`` and 8 or 12 bytes for ``ChaCha20``.
            If not passed, a random nonce is created; you will find it in the
            ``nonce`` attribute of the new object.
        data (bytes/bytearray/memoryview):
            Optional. The very first chunk of the message to authenticate.
            It is equivalent to an early call to ``update()``.

    Returns:
        A :class:`Poly1305_MAC` object
    ÚcipherNÚ_derive_Poly1305_key_pairz*Parameter 'cipher' must be AES or ChaCha20r>   zYou must pass a parameter 'key'Únoncer!   zUnknown parameters: )	ÚpopÚhasattrr   r(   ÚstrrP   r   r   rQ   )ÚkwargsrO   Ú
cipher_keyrQ   r!   r   r    Únew_macs           r$   r?   r?   °   sî   € ð. �ZŠZ˜ $Ñ'Ô'€FÝ�6Ð6Ñ7Ô7ð GÝÐEÑFÔFÐFà—’˜E 4Ñ(Ô(€JØÐÝÐ9Ñ:Ô:Ð:à�JŠJ�w Ñ%Ô%€EØ�:Š:�f˜dÑ#Ô#€Dàð >ÝÐ.µ°V±´Ñ<Ñ=Ô=Ð=à×2Ò2°:¸uÑEÔE�K€A€qˆ%å˜1˜a Ñ&Ô&€GÝ  d¨EÑ2Ô2€G„MØ€Nr&   N)Úbinasciir   ÚCrypto.Util.py3compatr   r   r   ÚCrypto.Hashr   ÚCrypto.Randomr   ÚCrypto.Util._raw_apir	   r
   r   r   r   r   r   r   Úobjectr   r?   rM   r&   r$   ú<module>r^      s  ðð. Ð Ð Ð Ð Ð à <Ð <Ð <Ð <Ð <Ð <Ð <Ð <Ð <Ð <à Ð Ð Ð Ð Ð Ø *Ð *Ð *Ð *Ð *Ð *ð/ð /ð /ð /ð /ð /ð /ð /ð /ð /ð /ð /ð /ð /ð /ð /ð /ð /ð *Ð)Ð*Aðñô €ð"w5ð w5ð w5ð w5ð w5�6ñ w5ô w5ð w5ðv)ð )ð )ð )ð )r&   