관리-도구
편집 파일: test_CAST.cpython-311.pyc
� O�Dg� � � � d Z ddlZddlmZ ddlmZ g d�Z G d� dej � � Z G d� d ej � � Z i fd �Z edk rd� Z ej d �� � dS dS )z&Self-test suite for Crypto.Cipher.CAST� N)�bchr)�CAST))�0123456789abcdef�238b4fe5847e44b2� 0123456712345678234567893456789az128-bit key)r �eb6a711a2c02271b�01234567123456782345z 80-bit key)r �7ac816d16e9b302e� 0123456712z 40-bit keyc � � e Zd Zd� ZdS )� KeyLengthc � � | � t t j t d� � dz t j � � | � t t j t d� � dz t j � � d S )Nr � � )�assertRaises� ValueErrorr �newr �MODE_ECB)�selfs ��/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib64/python3.11/site-packages/Crypto/SelfTest/Cipher/test_CAST.py�runTestzKeyLength.runTest4 sX � ����*�d�h��Q���!��T�]�K�K�K����*�d�h��Q���"��d�m�L�L�L�L�L� N��__name__� __module__�__qualname__r � r r r r 2 s( � � � � � �M� M� M� M� Mr r c � � e Zd Zd� ZdS )� TestOutputc � � t j dt j � � }d}|� |� � }t d� � }|� ||�� � }| � ||� � | � |d � � |� ||�� � }| � ||� � | � |d � � t t d� � � � }|� ||�� � | � ||� � |� ||�� � | � ||� � | � t |j |d�� � | � t |j |d�� � t d� � }| � t |j ||�� � | � t |j ||�� � d S )Ns 4444444444444444s 5555555555555555� )�outputs 0000000000000000� )r r r �encrypt� bytearray�assertEqual�decrypt� memoryviewr � TypeErrorr )r �cipher�pt�ctr"