관리-도구
편집 파일: TupleHash128.cpython-311.pyc
� O�Dgp � �X � d dl mZmZmZ ddlmZ ddlmZmZ G d� de� � Z d� Z dS ) � )�bord�is_bytes�tobytes� )� cSHAKE128)�_encode_str� _right_encodec �0 � e Zd ZdZd� Zd� Zd� Zd� Zd� ZdS )� TupleHashz\A Tuple hash object. Do not instantiate directly. Use the :func:`new` function. c �Z � || _ |� d|d� � | _ d | _ d S )N� s TupleHash)�digest_size�_new�_cshake�_digest)�self�custom�cshaker s �z/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib64/python3.11/site-packages/Crypto/Hash/TupleHash128.py�__init__zTupleHash.__init__+ s, � �&����{�{�3���=�=�������r c �� � | j �t d� � �t |� � st d� � �| j � t t |� � � � � � | S )z�Authenticate the next byte string in the tuple. Args: data (bytes/bytearray/memoryview): The next byte string. Nz6You cannot call 'update' after 'digest' or 'hexdigest'z#You can only call 'update' on bytes)r � TypeErrorr r �updater r )r �datas r r zTupleHash.update2 sb � � �<�#��T�U�U�U���~�~� C��A�B�B�B�����K��� � �6�6�7�7�7��r c �� � | j �S| j � t | j dz � � � � | j � | j � � | _ | j S )z�Return the **binary** (non-printable) digest of the tuple of byte strings. :return: The hash digest. Binary form. :rtype: byte string N� )r r r r r �read�r s r �digestzTupleHash.digestC sT � � �<���L��� �d�.>��.B� C� C�D�D�D��<�,�,�T�-=�>�>�D�L��|�r c �~ � d� d� t | � � � � � D � � � � S )z�Return the **printable** digest of the tuple of byte strings. :return: The hash digest. Hexadecimal encoded. :rtype: string � c �2 � g | ]}d t |� � z ��S )z%02x)r )�.0�xs r � <listcomp>z'TupleHash.hexdigest.<locals>.<listcomp>W s# � �G�G�G�Q���a���(�G�G�Gr )�join�tupler r s r � hexdigestzTupleHash.hexdigestP s5 � � �w�w�G�G�%���� � �2F�2F�G�G�G�H�H�Hr c �>