File: //opt/saltstack/salt/lib/python3.10/site-packages/Cryptodome/Cipher/__pycache__/AES.cpython-310.pyc
o
;ja# � @ s� d dl Z d dlmZ d dlmZmZmZmZmZ d dl m
Z
d dlmZ dZ
dZdZd Zd
ZdZdZd
ZdZdZdZdZdZdZede�ZzdZe
�� rUede�dd��ZW n ey_ Y nw dd� Z dd� Z!dd� 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);
zCryptodome.Cipher._raw_aeszCryptodome.Cipher._raw_aesniZAESZAESNIc C s� | � dd�}z| � d�}W n ty td��w t|�tvr'tdt|� ��|r2tr2tj}tj}nt j
}t j}t� }|t
|�tt|��|�� �}|rQtd| ��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_libZAESNI_start_operationZAESNI_stop_operation�_raw_aes_libZAES_start_operationZAES_stop_operationr r r Z
address_ofr �get)Zdict_parametersr r Zstart_operationZstop_operation�cipher�result� r$ �I/opt/saltstack/salt/lib/python3.10/site-packages/Cryptodome/Cipher/AES.py�_create_base_cipherO s. �
��r&