????
Current Path : /opt/imunify360/venv/lib64/python3.11/site-packages/Crypto/Cipher/__pycache__/ |
Current File : //opt/imunify360/venv/lib64/python3.11/site-packages/Crypto/Cipher/__pycache__/AES.cpython-311.pyc |
� ���n+��� �, � d dl Z d dlmZ d dlmZmZmZmZmZ d dl m Z d dlmZ dZ dZdZd Zd ZdZdZd ZdZdZdZdZ ede� � Z dZ e j � � r ede� dd� � � � Zn# e$ r Y nw xY wd� Zd� Zd� Z dZ!dZ"dS )� N)�_create_cipher)�load_pycryptodome_raw_lib�VoidPointer�SmartPointer�c_size_t�c_uint8_ptr)� _cpu_features)�get_random_bytes� � � � � � � � � � � a int AES_start_operation(const uint8_t key[], size_t key_len, void **pResult); int AES_encrypt(const void *state, const uint8_t *in, uint8_t *out, size_t data_len); int AES_decrypt(const void *state, const uint8_t *in, uint8_t *out, size_t data_len); int AES_stop_operation(void *state); zCrypto.Cipher._raw_aeszCrypto.Cipher._raw_aesni�AES�AESNIc � � | � dd� � } | � d� � }n# t $ r t d� � �w xY wt |� � t vrt dt |� � z � � �|r t rt j }t j }nt j }t j }t � � } |t |� � t t |� � � � |� � � � � }|rt d|z � � �t! |� � � |� � S )z}This method instantiates and returns a handle to a low-level base cipher. It will absorb named parameters in the process.� use_aesniT�keyzMissing 'key' parameterz#Incorrect AES key length (%d bytes)z+Error %X while instantiating the AES cipher)�pop�KeyError� TypeError�len�key_size� ValueError�_raw_aesni_lib�AESNI_start_operation�AESNI_stop_operation�_raw_aes_lib�AES_start_operation�AES_stop_operationr r r � address_ofr �get)�dict_parametersr r �start_operation�stop_operation�cipher�results �s/builddir/build/BUILD/imunify360-venv-2.5.0/opt/imunify360/venv/lib64/python3.11/site-packages/Crypto/Cipher/AES.py�_create_base_cipherr/ N s> � � �#�#�K��6�6�I�3��!�!�%�(�(����� 3� 3� 3��1�2�2�2�3���� �3�x�x�x����>��S���I�J�J�J�� 9�^� 9�(�>��'�<���&�:��%�8�� �]�]�F� �_�[��-�-�%�c�#�h�h�/�/�#�.�.�0�0�2� 2�F� � #��F�!�"� #� #� #��� � ���n�5�5�5s �. �Ac �( � t | � � dk rt d� � �|�t d� � }n"t |� � dk rt d� � �t | dd� t � � � |� � }| dd� ||fS )zrDerive a tuple (r, s, nonce) for a Poly1305 MAC. If nonce is ``None``, a new 16-byte nonce is generated. � z(Poly1305 with AES requires a 32-byte keyN� z*Poly1305 with AES requires a 16-byte nonce)r r r �new�MODE_ECB�encrypt)r �nonce�ss r. �_derive_Poly1305_key_pairr8 m s� � � �3�x�x�2�~�~��C�D�D�D��}� ��$�$��� �U���r� � ��E�F�F�F��C����H�h���'�'��.�.�A��r�s�s�8�Q���� c �Z � d|d<