Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/Cryptodome/Hash/__pycache__/keccak.cpython-39.pyc
Ðазад
a b�h� � @ sV d dl mZ d dlmZmZmZmZmZmZm Z edd�Z G dd� de�Zdd� Z d S ) � ��bord)�load_pycryptodome_raw_lib�VoidPointer�SmartPointer�create_string_buffer�get_raw_buffer�c_size_t�c_uint8_ptrzCryptodome.Hash._keccaka� int keccak_init(void **state, size_t capacity_bytes, uint8_t padding_byte); int keccak_destroy(void *state); int keccak_absorb(void *state, const uint8_t *in, size_t len); int keccak_squeeze(const void *state, uint8_t *out, size_t len); int keccak_digest(void *state, uint8_t *digest, size_t len); c @ s8 e Zd ZdZdd� Zdd� Zdd� Zdd � Zd d� ZdS ) �Keccak_Hashz�A Keccak hash object. Do not instantiate directly. Use the :func:`new` function. :ivar digest_size: the size in bytes of the resulting hash :vartype digest_size: integer c C sh || _ || _d| _t� }t�|�� t| j d �d�}|rDtd| ��t |� � tj�| _|rd| � |� d S )NF� � z#Error %d while instantiating keccak)�digest_size�_update_after_digest�_digest_doner �_raw_keccak_libZkeccak_initZ address_ofr � ValueErrorr �getZkeccak_destroy�_state�update)�self�data�digest_bytes�update_after_digest�state�result� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/Cryptodome/Hash/keccak.py�__init__? s ��zKeccak_Hash.__init__c C sH | j r| jstd��t�| j�� t|�tt |���}|rDt d| ��| S )z�Continue hashing of a message by consuming the next chunk of data. Args: data (byte string/byte array/memoryview): The next chunk of the message being hashed. z8You can only call 'digest' or 'hexdigest' on this objectzError %d while updating keccak)r r � TypeErrorr Z keccak_absorbr r r r �lenr )r r r r r r r Q s �zKeccak_Hash.updatec C sB d| _ t| j�}t�| j�� |t| j��}|r:td| ��t |�S )z�Return the **binary** (non-printable) digest of the message that has been hashed so far. :return: The hash digest, computed over the data processed so far. Binary form. :rtype: byte string TzError %d while squeezing keccak) r r r r Z keccak_digestr r r r r )r Zbfrr r r r �digestb s �zKeccak_Hash.digestc C s d� dd� | �� D ��S )z�Return the **printable** digest of the message that has been hashed so far. :return: The hash digest, computed over the data processed so far. Hexadecimal encoded. :rtype: string � c S s g | ]}d t |� �qS )z%02xr )�.0�xr r r � <listcomp>| � z)Keccak_Hash.hexdigest.<locals>.<listcomp>)�joinr! )r r r r � hexdigestt s zKeccak_Hash.hexdigestc K s( d|vrd|vr| j |d<