관리-도구
편집 파일: test_SIV.cpython-311.pyc
� O�Dg�M � �z � d dl Z d dlZd dlmZ d dlmZ d dlmZ d dlm Z m Z d dlmZ d dl mZ d dlmZ d � Z G d � dej � � Z G d� d ej � � Zd� Z G d� dej � � Z G d� dej � � Z G d� dej � � Zi fd�Zedk rd� Z ej 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_SIV.py�get_tag_randomr - s) � ��<�W�S�\�\�*�*�*�/�/��7�7�7� c �� � e Zd Z edd� � Z edd� � Z edd� � Z edd� � Z ed d � � Zd� Z d� Z d � Zd� Zd� Z d� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� ZdS )�SivTests�key_256� �key_384�0 �key_512�@ � nonce_128� r � c �t � | j | j | j fD ]�}t j |t j | j �� � }t dd� � }|� |� � \ }}t j |t j | j �� � }|� ||� � }| � ||� � ��d S )N��nonce� plaintexti@ )r r r r r �MODE_SIV�nonce_96r �encrypt_and_digest�decrypt_and_verify�assertEqual)�self�key�cipher�pt�ct�mac�pt2s r �test_loopback_128zSivTests.test_loopback_1289 s� � ��<���t�|�;� &� &�C��W�S�#�,�d�m�D�D�D�F���X�6�6�B��/�/��3�3�G�B���W�S�#�,�d�m�D�D�D�F��+�+�B��4�4�C����R��%�%�%�%� &� &r c � � t j | j t j � � t j | j t j | j � � }|� | j � � \ }}t j | j t j | j �� � }|� | j � � \ }}| � ||z ||z � � d S �Nr! )r r r r$ r% r&