관리-도구
편집 파일: test_CTR.cpython-311.pyc
� O�DgBS � � � d dl Z d dlmZmZ d dlmZ d dlmZmZ d dl m Z mZ d dlm Z mZ d dlmZ d� Z G d � d e j � � Z G d� de j � � Z G d � de j � � Zi fd�Zedk rd� Z e j d�� � dS dS )� N)�hexlify� unhexlify)�list_test_cases)�tobytes�bchr)�AES�DES3)�SHAKE128�SHA256)�Counterc �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_CTR.py�get_tag_randomr ( s) � ��<�W�S�\�\�*�*�*�/�/��7�7�7� c �4 � e Zd Z edd� � Z edd� � Z edd� � Z edd� � Z ej d e� � � Z ej de� � � Zd� Zd � Z d� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd � Z d!S )"�CtrTests�key_128� �key_192� �nonce_32� �nonce_64� � ��prefix�@ c �R � t j | j t j | j �� � }t dd� � }|� |� � }t j | j t j | j �� � }|� |� � }| � ||� � d S )N��counter� plaintexti@ ) r r r �MODE_CTR�ctr_128r �encrypt�decrypt�assertEqual��self�cipher�pt�ct�pt2s r �test_loopback_128zCtrTests.test_loopback_1284 s� � �����s�|�T�\�J�J�J�� �K�� 2� 2�� �^�^�B� � ������s�|�T�\�J�J�J���n�n�R� � ������S�!�!�!�!�!r c �R � t j | j t j | j �� � }t dd� � }|� |� � }t j | j t j | j �� � }|� |� � }| � ||� � d S )Nr% r'