File: //var/opt/nydus/ops/cryptography/hazmat/backends/openssl/__pycache__/aead.cpython-39.pyc
a
�,�h� � @ s d dl Z d dlmZ e jrVd dlmZ d dlmZmZm Z m
Z
mZ e jeee e
ef Z
dZd Zded�dd �Zed
d�dd
�Zd
eeee je eed�dd�Zd
edd�dd�Zd
edd�dd�Zd
eed�dd�Zd
deee je eed�dd�Zd
deee je eed�dd�ZdS )� N)�
InvalidTag)�Backend��AESCCM�AESGCM�AESOCB3�AESSIV�ChaCha20Poly1305� �_AEAD_TYPES)�cipher�returnc C s� ddl m}m}m}m}m} t| |�r*dS t| |�rPdt| j�d � d�� d�S t| |�rvdt| j�d � d�� d�S t| |�r�dt| j�d d � d
�� d�S t| |�s�J �dt| j�d � d�� d�S d S )Nr r s chacha20-poly1305zaes-� z-ccm�asciiz-ocb� z-sivz-gcm)
�+cryptography.hazmat.primitives.ciphers.aeadr r r r r �
isinstance�len�_key�encode)r r r r r r � r �\/opt/nydus/tmp/pip-target-wkfpz8uv/lib64/python/cryptography/hazmat/backends/openssl/aead.py�_aead_cipher_name s
r r )�cipher_name�backendc C sj | � d�rH|j�|jj| |jj�}|�||jjk� |j�||jj�}n|j�| �}|�||jjk� |S )Ns -siv) �endswith�_libZEVP_CIPHER_fetch�_ffi�NULL�openssl_assert�gcZEVP_CIPHER_freeZEVP_get_cipherbyname)r r �
evp_cipherr r r �_evp_cipher2 s
�r"