관리-도구
편집 파일: test_CMAC.cpython-311.pyc
� O�Dg04 � �Z � d Z ddlZddlZddlmZ ddlmZ ddlmZ ddl m Z mZ ddlmZ ddl mZ dd lmZ dd lmZ ddd de fdddde fdddde fdddde fdddde fdddde fdddde fdddd e fd!dd"d#e fd!dd$d%e fd!dd&d'e fd!dd(d)e fd*dd+d,efd*d-d.d/efd*d0d1d2efd*d3d4d5efd6dd7d8efd6d-d9d:efd6d0d;d<efd6d3d=d>efgad?� Z G d@� dAej � � Z G dB� dCej � � Z G dD� dEej � � Z G dF� dGej � � Zi fdH�ZedIk rddlZdJ� Z ej dK�L� � dS dS )Mz$Self-test suite for Crypto.Hash.CMAC� N)� unhexlify)�tobytes)�CMAC)�AES�DES3)�SHAKE128)�strxor)�list_test_cases)�load_test_vectors_wycheproof� 2b7e151628aed2a6abf7158809cf4f3c� � bb1d6929e95937287fa37d129b756746zRFC 4493 #1� 6bc1bee22e409f96e93d7e117393172a� 070a16b46b4d4144f79bdd9dd04a287czRFC 4493 #2�P6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411� dfa66747de9ae63030ca32611497c827zRFC 4493 #3ڀ6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710� 51f0bebf7e3b9d92fc49741779363cfezRFC 4493 #4�08e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b� d17ddf46adaacde531cac483de7a9367zNIST SP 800 38B D.2 Example 5� 9e99a7bf31e710900662f65e617c5184zNIST SP 800 38B D.2 Example 6� 8a1de5be2eb31aad089a82e6ee908b0ezNIST SP 800 38B D.2 Example 7� a1d5df0eed790f794d77589659f39a11zNIST SP 800 38B D.2 Example 8�@603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4� 028962f61b7bf89efc6b551f4667d983zNIST SP 800 38B D.3 Example 9� 28a7023f452e8f82bd4bf28d8c37c35czNIST SP 800 38B D.3 Example 10� aaf3d8f1de5640c232f5b169b9c911e6zNIST SP 800 38B D.3 Example 11� e1992190549f6ed5696a2c056c315410zNIST SP 800 38B D.3 Example 12�08aa83bf8cbda10620bc1bf19fbb6cd58bc313d4a371ca8b5�b7a688e122ffaf95zNIST SP 800 38B D.4 Example 13�6bc1bee22e409f96�8e8f293136283797zNIST SP 800 38B D.4 Example 14�(6bc1bee22e409f96e93d7e117393172aae2d8a57�743ddbe0ce2dc2edzNIST SP 800 38B D.4 Example 15�@6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51�33e6b1092400eae5zNIST SP 800 38B D.4 Example 16� 4cf15134a2850dd58a3d10ba80570d38�bd2ebf9a3ba00361zNIST SP 800 38B D.7 Example 17�4ff2ab813c53ce83zNIST SP 800 38B D.7 Example 18�62dd1b471902bd4ezNIST SP 800 38B D.7 Example 19�31b1e431dabc4eb8zNIST SP 800 38B D.7 Example 20c �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/Hash/test_CMAC.py�get_tag_randomr4 � s) � ��<�W�S�\�\�*�*�*�/�/��7�7�7� c � � e Zd Zd� Zd� ZdS )�TestCMACc � ��� t dd� � �t dd� � }t j |�t �� � � � � }dD ]����fd�t dt �� � �� � D � � }t j |t � � � }|D ]}|� |� � �| � ||� � � � � ��d S )z5Verify that internal caching is implemented correctly�data_to_mac� �key� )�msg� ciphermod) � � � � � � r<