관리-도구
편집 파일: test_CBC.cpython-311.pyc
� O�Dg�N � � � d dl Z d dlmZ d dlmZ d dlmZ d dlmZm Z d dl mZmZm Z d dlmZ d� Z G d � d e j � � Z G d� de� � Z G d � de j � � Z G d� de� � ZdZdZeD ]Zefd�Z eedez e� � �eD ]Zefd�Z eedez e� � �[[dZeD ]Zefd�Z eedez e� � � G d� de j � � Zi fd�Zedk rd� Z e j d�� � dS dS ) � N)� unhexlify)�load_test_vectors)�list_test_cases)�tobytes� is_string)�AES�DES3�DES)�SHAKE128c �l � t j t | � � �� � � |� � S )N)�data)r �newr �read)�tag�lengths ��/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib64/python3.11/site-packages/Crypto/SelfTest/Cipher/test_CBC.py�get_tag_randomr ) s) � ��<�W�S�\�\�*�*�*�/�/��7�7�7� c � � e Zd Z edd� � Z edd� � Z edd� � Z edd� � Z edd� � Zd � Z d � Z d� Zd� Zd � Z d� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� ZdS )�BlockChainingTests�key_128� �key_192� �iv_128�iv_64� �data_128c �: � t j | j | j | j � � }t dd� � }|� |� � }t j | j | j | j � � }|� |� � }| � ||� � d S )N� plaintext�@ ) r r r �aes_moder r �encrypt�decrypt�assertEqual��self�cipher�pt�ct�pt2s r �test_loopback_128z$BlockChainingTests.test_loopback_1284 s� � �����t�}�d�k�B�B�� �K�� 2� 2�� �^�^�B� � ������t�}�d�k�B�B���n�n�R� � ������S�!�!�!�!�!r c �: � t j | j | j | j � � }t dd� � }|� |� � }t j | j | j | j � � }|� |� � }| � ||� � d S )Nr i ) r r r � des3_moder r r# r$ r% r&