관리-도구
편집 파일: test_CCM.cpython-311.pyc
� O�Dg�� � �F � d dl Z d dlmZ d dlmZ d dlmZ d dlmZm Z d dl mZ d dlm Z d dlmZ d � Z G d � de j � � 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�� unhexlify)�list_test_cases)�load_test_vectors_wycheproof)�tobytes�bchr)�AES)�SHAKE128)�strxorc �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_CCM.py�get_tag_randomr + s) � ��<�W�S�\�\�*�*�*�/�/��7�7�7� c �� � e Zd Z edd� � Z edd� � Z edd� � Zd� Zd� 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 )�CcmTests�key_128� � nonce_128� r � c �R � t j | j t j | j �� � }t dd� � }|� |� � }t j | j t j | j �� � }|� |� � }| � ||� � d S )N��nonce� plaintexti@ ) r r r �MODE_CCM�nonce_96r �encrypt�decrypt�assertEqual)�self�cipher�pt�ct�pt2s r �test_loopback_128zCcmTests.test_loopback_1285 s� � �����s�|�4�=�I�I�I�� �K�� 2� 2�� �^�^�B� � ������s�|�4�=�I�I�I���n�n�R� � ������S�!�!�!�!�!r c �^ � t j | j t j � � }|j }t j | j t j � � }|j }| � t |� � d� � | � ||� � t j | j t j | j � � }|� | j � � }t j | j t j | j �� � }| � ||� | j � � � � d S )N� r )r r r r r r$ �len�assertNotEqualr! r"