관리-도구
편집 파일: test_GCM.cpython-311.pyc
� O�Dg�� � �� � d dl mZ d dlZd dlmZ d dlmZ d dlmZm Z d dl mZmZ d dl mZ d dlmZmZ d d lmZ d � Z G d� dej � � Z G d � dej � � Z G d� dej � � Z G d� dej � � Z G d� dej � � Z G d� dej � � Z eddddd� i� � pg Ze eddddd� i� � pg z Z ee� � D ]7\ ZZ e ee!� � r�efd�Z" e#ed ez e"� � e#ed ez e"� � �8 G d!� d"ej � � Z$ G d#� d$ej � � Z%i fd%�Z&e'd&k rd'� Z( ej) d(�)� � dS dS )*� )�print_functionN�� unhexlify)�list_test_cases)�load_test_vectors�load_test_vectors_wycheproof)�tobytes�bchr)�AES)�SHAKE128�SHA256)�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_GCM.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� ZdS )�GcmTests�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_GCM�nonce_96r �encrypt�decrypt�assertEqual)�self�cipher�pt�ct�pt2s r �test_loopback_128zGcmTests.test_loopback_1288 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 � � t j | j t j | j � � }|� | j � � }t j | j t j | j �� � }| � ||� | j � � � � d S �Nr )r r r r# r$ r% r r'