%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/nacl/bindings/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/nacl/bindings/__pycache__/crypto_aead.cpython-312.pyc

�

�f�<�
��UddlmZddlmZddlmZmZddlm	Z		ej�Zee
d<ej�Zee
d<ej �Zee
d<ej$�Zee
d<ej(�Zee
d	<eezZej.�Zee
d
<ej2�Zee
d<ej6�Zee
d<ej:�Zee
d
<ej>�Z ee
d<e ezZ!ejD�Z#ee
d<ejH�Z%ee
d<ejL�Z'ee
d<ejP�Z)ee
d<ejT�Z+ee
d<e+e)zZ,de-dee-de-de-de-f
d�Z.de-dee-de-de-de-f
d�Z/de-dee-de-de-de-f
d�Z0de-dee-de-de-de-f
d�Z1de-dee-de-de-de-f
d�Z2de-dee-de-de-de-f
d�Z3y )!�)�Optional)�
exceptions)�ffi�lib)�ensure�*crypto_aead_chacha20poly1305_ietf_KEYBYTES�+crypto_aead_chacha20poly1305_ietf_NSECBYTES�+crypto_aead_chacha20poly1305_ietf_NPUBBYTES�(crypto_aead_chacha20poly1305_ietf_ABYTES�2crypto_aead_chacha20poly1305_ietf_MESSAGEBYTES_MAX�%crypto_aead_chacha20poly1305_KEYBYTES�&crypto_aead_chacha20poly1305_NSECBYTES�&crypto_aead_chacha20poly1305_NPUBBYTES�#crypto_aead_chacha20poly1305_ABYTES�-crypto_aead_chacha20poly1305_MESSAGEBYTES_MAX�+crypto_aead_xchacha20poly1305_ietf_KEYBYTES�,crypto_aead_xchacha20poly1305_ietf_NSECBYTES�,crypto_aead_xchacha20poly1305_ietf_NPUBBYTES�)crypto_aead_xchacha20poly1305_ietf_ABYTES�3crypto_aead_xchacha20poly1305_ietf_MESSAGEBYTES_MAX�message�aad�nonce�key�returnc���tt|t�dtj��t|�}t|tkdjt�tj��tt|t�xs|dudtj��tt|t�xrt|�tk(djt�tj��tt|t�xrt|�tk(djt�tj��|r|}t|�}ntj}d}|tz}tjd	�}tjd
|�}	tj |	|||||tj||�	}
t|
dk(dtj"��tj$|	|d�ddS)aZ
    Encrypt the given ``message`` using the IETF ratified chacha20poly1305
    construction described in RFC7539.

    :param message:
    :type message: bytes
    :param aad:
    :type aad: Optional[bytes]
    :param nonce:
    :type nonce: bytes
    :param key:
    :type key: bytes
    :return: authenticated ciphertext
    :rtype: bytes
    � Input message type must be bytes��raising�%Message must be at most {} bytes longN�%Additional data must be bytes or None�,Nonce must be a {} bytes long bytes sequence�*Key must be a {} bytes long bytes sequencer�unsigned long long *�unsigned char[]�Encryption failed.)r�
isinstance�bytes�exc�	TypeError�lenr�format�
ValueErrorr
rr�NULLr�newr�)crypto_aead_chacha20poly1305_ietf_encrypt�CryptoError�buffer�rrrr�mlen�_aad�aalen�mxout�clen�
ciphertext�ress           �;/usr/lib/python3/dist-packages/nacl/bindings/crypto_aead.pyr0r0Ws���$��7�E�"�*��
�
���w�<�D�
��B�B�/�6�6�>�	
�������3���/�3�$�;�/��
�
����5�%� �	F���J�E�E�6�=�=�7�	
��
�
�
���3���	C���H�B�B�4�;�;�6�	
��
�
�
�����C����x�x�����;�;�E��7�7�)�*�D����*�E�2�J�

�
7�
7��D�'�4��u�c�h�h��s��C��3�!�8�)�3�?�?�C��:�:�j�$�q�'�*�1�-�-�r9c���tt|t�dtj��t|�}t|tkdjt�tj��tt|t�xs|dudtj��tt|t�xrt|�tk(djt�tj��tt|t�xrt|�tk(djt�tj��|tz
}tjd�}tjd	|�}|r|}t|�}	ntj}d
}	tj ||tj||||	||�	}
t|
d
k(dtj"��tj$||d
�ddS)aR
    Decrypt the given ``ciphertext`` using the IETF ratified chacha20poly1305
    construction described in RFC7539.

    :param ciphertext:
    :type ciphertext: bytes
    :param aad:
    :type aad: Optional[bytes]
    :param nonce:
    :type nonce: bytes
    :param key:
    :type key: bytes
    :return: message
    :rtype: bytes
    �#Input ciphertext type must be bytesr�(Ciphertext must be at most {} bytes longNr!r"r#r$r%r�Decryption failed.)rr'r(r)r*r+�*_aead_chacha20poly1305_ietf_CRYPTBYTES_MAXr,r-r
rrrr/r.r�)crypto_aead_chacha20poly1305_ietf_decryptr1r2�r9rrrr8r7r4rr5r6r:s           r;rBrB�s���$��:�u�%�-��
�
���z�?�D�
��:�:�2�9�9�6�	
�������3���/�3�$�;�/��
�
����5�%� �	F���J�E�E�6�=�=�7�	
��
�
�
���3���	C���H�B�B�4�;�;�6�	
��
�
�
�
�;�;�E��7�7�)�*�D��g�g�'��/�G�
����C����x�x����

�
7�
7���s�x�x��T�4���s��C��3�!�8�)�3�?�?�C��:�:�g�t�A�w�'��*�*r<c�
�tt|t�dtj��t|�}t|tkdjt�tj��tt|t�xs|dudtj��tt|t�xrt|�tk(djt�tj��tt|t�xrt|�tk(djt�tj��|r|}t|�}ntj}d}t|�}|tz}tjd	�}tjd
|�}	tj |	|||||tj||�	}
t|
dk(dtj"��tj$|	|d�ddS)a[
    Encrypt the given ``message`` using the "legacy" construction
    described in draft-agl-tls-chacha20poly1305.

    :param message:
    :type message: bytes
    :param aad:
    :type aad: Optional[bytes]
    :param nonce:
    :type nonce: bytes
    :param key:
    :type key: bytes
    :return: authenticated ciphertext
    :rtype: bytes
    rrr Nr!r"r#rr$r%r&)rr'r(r)r*r+rr,r-rr
rr.rr/r�$crypto_aead_chacha20poly1305_encryptr1r2r3s           r;rErE�s���$��7�E�"�*��
�
���w�<�D�
��=�=�/�6�6�9�	
�������3���/�3�$�;�/��
�
����5�%� �	A���J�@�@�6�=�=�2�	
��
�
�
���3���	>���H�=�=�4�;�;�1�	
��
�
�
�����C����x�x�����w�<�D��;�;�E��7�7�)�*�D����*�E�2�J�

�
2�
2��D�'�4��u�c�h�h��s��C��3�!�8�)�3�?�?�C��:�:�j�$�q�'�*�1�-�-r<c���tt|t�dtj��t|�}t|tkdjt�tj��tt|t�xs|dudtj��tt|t�xrt|�tk(djt�tj��tt|t�xrt|�tk(djt�tj��|tz
}tjd�}tjd	|�}|r|}t|�}	ntj}d
}	tj ||tj||||	||�	}
t|
d
k(dtj"��tj$||d
�ddS)al
    Decrypt the given ``ciphertext`` using the "legacy" construction
    described in draft-agl-tls-chacha20poly1305.

    :param ciphertext: authenticated ciphertext
    :type ciphertext: bytes
    :param aad:
    :type aad: Optional[bytes]
    :param nonce:
    :type nonce: bytes
    :param key:
    :type key: bytes
    :return: message
    :rtype: bytes
    r>rr?Nr!r"r#r$r%rr@)rr'r(r)r*r+�%_aead_chacha20poly1305_CRYPTBYTES_MAXr,r-rr
rrr/r.r�$crypto_aead_chacha20poly1305_decryptr1r2rCs           r;rHrHEs���$��:�u�%�-��
�
���z�?�D�
��5�5�2�9�9�1�	
�������3���/�3�$�;�/��
�
����5�%� �	A���J�@�@�6�=�=�2�	
��
�
�
���3���	>���H�=�=�4�;�;�1�	
��
�
�
�
�6�6�E��7�7�)�*�D��g�g�'��/�G�
����C����x�x����

�
2�
2���s�x�x��T�4���s��C��3�!�8�)�3�?�?�C��:�:�g�t�A�w�'��*�*r<c�
�tt|t�dtj��t|�}t|tkdjt�tj��tt|t�xs|dudtj��tt|t�xrt|�tk(djt�tj��tt|t�xrt|�tk(djt�tj��|r|}t|�}ntj}d}t|�}|tz}tjd	�}tjd
|�}	tj |	|||||tj||�	}
t|
dk(dtj"��tj$|	|d�ddS)aD
    Encrypt the given ``message`` using the long-nonces xchacha20poly1305
    construction.

    :param message:
    :type message: bytes
    :param aad:
    :type aad: Optional[bytes]
    :param nonce:
    :type nonce: bytes
    :param key:
    :type key: bytes
    :return: authenticated ciphertext
    :rtype: bytes
    rrr Nr!r"r#rr$r%r&)rr'r(r)r*r+rr,r-rrrr.rr/r�*crypto_aead_xchacha20poly1305_ietf_encryptr1r2r3s           r;rJrJ�s���$��7�E�"�*��
�
���w�<�D�
��C�C�/�6�6�?�	
�������3���/�3�$�;�/��
�
����5�%� �	G���J�F�F�6�=�=�8�	
��
�
�
���3���	D���H�C�C�4�;�;�7�	
��
�
�
�����C����x�x�����w�<�D��<�<�E��7�7�)�*�D����*�E�2�J�

�
8�
8��D�'�4��u�c�h�h��s��C��3�!�8�)�3�?�?�C��:�:�j�$�q�'�*�1�-�-r<c���tt|t�dtj��t|�}t|tkdjt�tj��tt|t�xs|dudtj��tt|t�xrt|�tk(djt�tj��tt|t�xrt|�tk(djt�tj��|tz
}tjd�}tjd	|�}|r|}t|�}	ntj}d
}	tj ||tj||||	||�	}
t|
d
k(dtj"��tj$||d
�ddS)aU
    Decrypt the given ``ciphertext`` using the long-nonces xchacha20poly1305
    construction.

    :param ciphertext: authenticated ciphertext
    :type ciphertext: bytes
    :param aad:
    :type aad: Optional[bytes]
    :param nonce:
    :type nonce: bytes
    :param key:
    :type key: bytes
    :return: message
    :rtype: bytes
    r>rr?Nr!r"r#r$r%rr@)rr'r(r)r*r+�+_aead_xchacha20poly1305_ietf_CRYPTBYTES_MAXr,r-rrrrr/r.r�*crypto_aead_xchacha20poly1305_ietf_decryptr1r2rCs           r;rMrM�s���$��:�u�%�-��
�
���z�?�D�
��;�;�2�9�9�7�	
�������3���/�3�$�;�/��
�
����5�%� �	G���J�F�F�6�=�=�8�	
��
�
�
���3���	D���H�C�C�4�;�;�7�	
��
�
�
�
�<�<�E��7�7�)�*�D��g�g�'��/�G�
����C����x�x����

�
8�
8���s�x�x��T�4���s��C��3�!�8�)�3�?�?�C��:�:�g�t�A�w�'��*�*r<N)4�typingr�naclrr)�nacl._sodiumrr�nacl.exceptionsr�*crypto_aead_chacha20poly1305_ietf_keybytesr�int�__annotations__�+crypto_aead_chacha20poly1305_ietf_nsecbytesr	�+crypto_aead_chacha20poly1305_ietf_npubbytesr
�(crypto_aead_chacha20poly1305_ietf_abytesr�2crypto_aead_chacha20poly1305_ietf_messagebytes_maxrrA�%crypto_aead_chacha20poly1305_keybytesr
�&crypto_aead_chacha20poly1305_nsecbytesr�&crypto_aead_chacha20poly1305_npubbytesr�#crypto_aead_chacha20poly1305_abytesr�-crypto_aead_chacha20poly1305_messagebytes_maxrrG�+crypto_aead_xchacha20poly1305_ietf_keybytesr�,crypto_aead_xchacha20poly1305_ietf_nsecbytesr�,crypto_aead_xchacha20poly1305_ietf_npubbytesr�)crypto_aead_xchacha20poly1305_ietf_abytesr�3crypto_aead_xchacha20poly1305_ietf_messagebytes_maxrrLr(r0rBrErHrJrM�r<r;�<module>rdsA���"�!�"��3�C�2�2�4�+�C��4�C�3�3�5�,�S��4�C�3�3�5�,�S��1�C�0�0�2�)�#��;�C�:�:�<�3�C��7�.�/�+�.�C�-�-�/�&�s��/�C�.�.�0�'���/�C�.�.�0�'���,�C�+�+�-�$�S��6�C�5�5�7�.�s��2�)�*�&�4�C�3�3�5�,�S��5�C�4�4�6�-�c��5�C�4�4�6�-�c��2�C�1�1�3�*�3��<�C�;�;�=�4�S��8�/�0�,�L.�
�L.�!�%��L.�16�L.�=B�L.�
�L.�^L+��L+�$�U�O�L+�49�L+�@E�L+�
�L+�^M.�
�M.�!�%��M.�16�M.�=B�M.�
�M.�`L+��L+�$�U�O�L+�49�L+�@E�L+�
�L+�^M.�
�M.�!�%��M.�16�M.�=B�M.�
�M.�`K+��K+�$�U�O�K+�49�K+�@E�K+�
�K+r<

Zerion Mini Shell 1.0