관리-도구
편집 파일: test_OCB.cpython-311.pyc
� O�Dg � �P � d dl Z d dlmZ d dlmZmZmZ d dlmZ d dl m Z d dlmZ d dl mZ d dlmZ d � Z G d � de j � � Z G d� d e j � � Zd� Z G d� de j � � Z G d� de j � � Zi fd�Zedk rd� Z e j d�� � dS dS )� N)� unhexlify)�b�tobytes�bchr)� long_to_bytes)�load_test_vectors)�list_test_cases)�AES)�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_OCB.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� ZdS )�OcbTests�key_128� � nonce_128� r � c �Z � t j | j t j | j �� � }t dd� � }|� |� � \ }}t j | j t j | j �� � }|� ||� � }| � ||� � d S )N��nonce� plaintexti@ ) r r r �MODE_OCB�nonce_96r �encrypt_and_digest�decrypt_and_verify�assertEqual)�self�cipher�pt�ct�mac�pt2s r �test_loopback_128zOcbTests.test_loopback_1285 s� � �����s�|�4�=�I�I�I�� �K�� 2� 2���+�+�B�/�/���C�����s�|�4�=�I�I�I���'�'��C�0�0������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! �encryptr r$ �r% r&