관리-도구
편집 파일: test_KangarooTwelve.cpython-311.pyc
� O�Dg�( � �� � d Z ddlZddlmZ ddlmZ ddlmZ ddl m Z mZ G d� dej � � Z d � Zd � Zd� Z G d� d ej � � Zi fd�Zedk rd� Z ej d�� � dS dS )z.Self-test suite for Crypto.Hash.KangarooTwelve� N)� unhexlify)�list_test_cases)�KangarooTwelve)�b�bchrc �2 � e Zd Zd� Zd� Zd� Zd� Zd� Zd� ZdS )�KangarooTwelveTestc � � | � t j d� � d� � | � t j d� � d� � | � t j d� � d� � d S )Nr � � s i s )�assertEqual�K12�_length_encode)�selfs ��/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib64/python3.11/site-packages/Crypto/SelfTest/Hash/test_KangarooTwelve.py�test_length_encodez%KangarooTwelveTest.test_length_encode( sl � �����+�A�.�.��8�8�8�����+�B�/�/��=�=�=�����+�E�2�2�4G�H�H�H�H�H� c � � t j � � }t j t d� � �� � }t j � � � t d� � � � }| � |� d� � |� d� � � � |� d� � | � |� d� � |� d� � � � t j � � }|� d� � }t j t d� � �� � }t j t d� � �� � }| � ||� d� � � � | � ||� d� � � � t j t d� � �� � }t j t d� � t d� � �� � }t j t d� � �� � � t d� � � � }| � |� d� � |� d� � � � |� d� � | � |� d� � |� d� � � � d S )N�90��data� � ��custom�foo)r r )r �newr �update�assertNotEqual�readr )r �xof1�xof2�xof3�refs r �test_new_positivez$KangarooTwelveTest.test_new_positive- s� � ��w�y�y���w�A�d�G�G�$�$�$���w�y�y����$���(�(�����D�I�I�b�M�M�4�9�9�R�=�=�9�9�9�� � �"� � � �������2���� � �"� � �6�6�6��w�y�y���i�i��m�m���w�a��e�e�$�$�$���w�a��h�h�'�'�'������d�i�i��m�m�,�,�,����C����2���/�/�/��w�a��h�h�'�'�'���w�a��h�h�Q�t�W�W�5�5�5���w�a��h�h�'�'�'�.�.�q��w�w�7�7�����D�I�I�b�M�M�4�9�9�R�=�=�9�9�9�� � �"� � � �������2���� � �"� � �6�6�6�6�6r c �� � t d� � dz t d� � dz g}t j � � }|� |d � � � |d � � |� d� � }t j � � }|� |d |d z � � | � |� d� � |� � d S )Nr �� � i, r � )r r r r r r )r �pieces�h�digests r �test_updatezKangarooTwelveTest.test_updateG s� � ��r�(�(�S�.�$�r�(�(�S�.�1���G�I�I�� ��������"�"�6�!�9�-�-�-���������G�I�I�� ������V�A�Y�&�'�'�'����������V�,�,�,�,�,r c �n � t j � � }| � t |j d� � d S )N�string)r r �assertRaises� TypeErrorr )r r+ s r �test_update_negativez'KangarooTwelveTest.test_update_negativeP s- � ��G�I�I�����)�Q�X�y�9�9�9�9�9r c � � t j � � }|� d� � }| � t |t t d� � � � � � � � | � t |� � d� � d S )N�Z r, ) r r r � assertTrue� isinstance�typer r �len)r r+ r, s r �test_digestzKangarooTwelveTest.test_digestT sj � ��G�I�I��������� ��� �6�4��(���+<�+<�=�=�>�>�>�����V���b�)�)�)�)�)r c � � t j � � }|� t d� � � � |� d� � | � t |j t d� � � � d S )N�rrrrr4 �ttt)r r r r r r0 r1 )r �macs r �test_update_after_readz)KangarooTwelveTest.test_update_after_read\ sZ � ��g�i�i��� � �1�V�9�9��������������)�S�Z��5���:�:�:�:�:r N) �__name__� __module__�__qualname__r r% r- r2 r9 r>