
    k7i8                     6    S r SSKJr  SSKJr   " S S\5      rg)zauthlib.jose.draft.
~~~~~~~~~~~~~~~~~~~~

Content Encryption per `Section 4`_.

.. _`Section 4`: https://datatracker.ietf.org/doc/html/draft-amringer-jose-chacha-02#section-4
    )ChaCha20_Poly1305)JWEEncAlgorithmc                   *    \ rS rSrSrS rS rS rSrg)XC20PEncAlgorithm      c                 8    SU l         SU l        Xl        Xl        g )NXC20PzXChaCha20-Poly1305)namedescriptionkey_sizeCEK_SIZE)selfr   s     a/home/james-whalen/.local/lib/python3.13/site-packages/authlib/jose/drafts/_jwe_enc_cryptodome.py__init__XC20PEncAlgorithm.__init__   s    	/      c                     U R                  U5        [        R                  " XCS9nUR                  U5        UR	                  U5      u  pgXg4$ )zContent Encryption with AEAD_XCHACHA20_POLY1305.

:param msg: text to be encrypt in bytes
:param aad: additional authenticated data in bytes
:param iv: initialization vector in bytes
:param key: encrypted key in bytes
:return: (ciphertext, tag)
keynonce)check_ivCryptodome_ChaCha20_Poly1305newupdateencrypt_and_digest)r   msgaadivr   chacha
ciphertexttags           r   encryptXC20PEncAlgorithm.encrypt   sF     	b-11cDc 33C8
r   c                     U R                  U5        [        R                  " XSS9nUR                  U5        UR	                  X5      $ )a  Content Decryption with AEAD_XCHACHA20_POLY1305.

:param ciphertext: ciphertext in bytes
:param aad: additional authenticated data in bytes
:param iv: initialization vector in bytes
:param tag: authentication tag in bytes
:param key: encrypted key in bytes
:return: message
r   )r   r   r   r   decrypt_and_verify)r   r!   r   r   r"   r   r    s          r   decryptXC20PEncAlgorithm.decrypt(   s=     	b-11cDc((99r   )r   r   r   r   N)	__name__
__module____qualname____firstlineno__IV_SIZEr   r#   r'   __static_attributes__ r   r   r   r      s     G!:r   r   N)__doc__Cryptodome.Cipherr   r   authlib.jose.rfc7516r   r   r/   r   r   <module>r3      s    P 0': ':r   