관리-도구
편집 파일: common.cpython-311.pyc
� �a��"��� �Z � d Z ddlZddlZddlZddlZddlZddlmZmZ ddl m Z mZ ddlm Z d� Z G d� dej � � Z G d � d ej � � Z G d� dej � � Z G d � dej � � Z G d� dej � � Z G d� dej � � Zdi fd�Zd� ZdS )z&Self-testing for PyCrypto hash modules� N)�hexlify� unhexlify)�b�tobytes)�strxor_cc �f � t j ddt | � � � � }t |� � S )Ns \s+� )�re�subr r )� hex_string�shorters �}/builddir/build/BUILD/imunify360-venv-2.5.2/opt/imunify360/venv/lib64/python3.11/site-packages/Crypto/SelfTest/Hash/common.py�t2br $ s+ � ��f�W�c�7�:�#6�#6�7�7�G��W���r c � � e Zd Zd� Zd� Zd� ZdS )�HashDigestSizeSelfTestc �| � t j � | � � || _ || _ || _ || _ d S �N)�unittest�TestCase�__init__�hashmod�expected�description�extra_params)�selfr r r r s r r zHashDigestSizeSelfTest.__init__+ s= � ���"�"�4�(�(�(���� �� �&���(����r c � � | j S r �r �r s r �shortDescriptionz'HashDigestSizeSelfTest.shortDescription2 � � ���r c �f � d| j vrM| � t | j d� � � � | � | j j | j � � | j j di | j ��}| � t |d� � � � | � |j | j � � d S )N�truncate�digest_size� )r � assertTrue�hasattrr �assertEqualr# r �new�r �hs r �runTestzHashDigestSizeSelfTest.runTest5 s� � ��T�.�.�.��O�O�G�D�L�-�@�@�A�A�A����T�\�5�t�}�E�E�E��D�L��1�1�t�0�1�1�������=�1�1�2�2�2������� �6�6�6�6�6r N��__name__� __module__�__qualname__r r r+ r$ r r r r ) sA � � � � � �)� )� )� � � �7� 7� 7� 7� 7r r c � � e Zd Zd� Zd� Zd� ZdS )�HashSelfTestc � � t j � | � � || _ |� � � | _ || _ || _ || _ d S r ) r r r r �lowerr �inputr r )r r r r r4 r s r r zHashSelfTest.__init__@ sN � ���"�"�4�(�(�(���� ���(�(�� ��� �&���(����r c � � | j S r r r s r r zHashSelfTest.shortDescriptionH r r c �b � | j j di | j ��}|� | j � � t j |� � � � � }|� � � } | j j | j fi | j ��}|� � � }t j |� � � � � }| � | j |� � t j d dk r7| � | j |� � | � | j |� � nZ| � | j � � � |� � | � | j � � � |� � | � | j |� � | j j dvst |d� � rq|� � � }|� | j � � t j |� � � � � }| � | j |� � d S d S )Nr � )zCrypto.Hash.MD5zCrypto.Hash.SHA1r( r$ )r r( r �updater4 �binascii�b2a_hex�digest� hexdigestr'