Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/Crypto/Hash/__pycache__/RIPEMD160.cpython-39.pyc
Ðазад
a c�h� � @ sd d dl mZ d dlmZmZmZmZmZmZm Z edd�Z G dd� de�Zd dd �Z ejZejZdS )� ��bord)�load_pycryptodome_raw_lib�VoidPointer�SmartPointer�create_string_buffer�get_raw_buffer�c_size_t�c_uint8_ptrzCrypto.Hash._RIPEMD160a int ripemd160_init(void **shaState); int ripemd160_destroy(void *shaState); int ripemd160_update(void *hs, const uint8_t *buf, size_t len); int ripemd160_digest(const void *shaState, uint8_t digest[20]); int ripemd160_copy(const void *src, void *dst); c @ sP e Zd ZdZdZdZdZddd�Zdd � Zd d� Z dd � Z dd� Zddd�ZdS )� RIPEMD160Hasha� A RIPEMD-160 hash object. Do not instantiate directly. Use the :func:`new` function. :ivar oid: ASN.1 Object ID :vartype oid: string :ivar block_size: the size in bytes of the internal message block, input to the compression function :vartype block_size: integer :ivar digest_size: the size in bytes of the resulting hash :vartype digest_size: integer � �@ z1.3.36.3.2.1Nc C sH t � }t�|�� �}|r$td| ��t|�� tj�| _|rD| � |� d S )Nz&Error %d while instantiating RIPEMD160) r �_raw_ripemd160_libZripemd160_initZ address_of� ValueErrorr �getZripemd160_destroy�_state�update)�self�data�state�result� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/Crypto/Hash/RIPEMD160.py�__init__L s ��zRIPEMD160Hash.__init__c C s4 t �| j�� t|�tt|���}|r0td| ��dS )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. �&Error %d while instantiating ripemd160N)r Zripemd160_updater r r r �lenr )r r r r r r r W s ��zRIPEMD160Hash.updatec C s4 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 r )r �digest_sizer Zripemd160_digestr r r r )r Zbfrr r r r �digeste s ��zRIPEMD160Hash.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+RIPEMD160Hash.hexdigest.<locals>.<listcomp>)�joinr )r r r r � hexdigestv s zRIPEMD160Hash.hexdigestc C s2 t � }t�| j�� |j�� �}|r.td| ��|S )a4 Return a copy ("clone") of the hash object. The copy will have the same internal state as the original hash object. This can be used to efficiently compute the digests of strings that share a common initial substring. :return: A hash object of the same type z Error %d while copying ripemd160)r r Zripemd160_copyr r r )r �cloner r r r �copy� s �zRIPEMD160Hash.copyc C s t |�S )z&Create a fresh RIPEMD-160 hash object.)r )r r r r r �new� s zRIPEMD160Hash.new)N)N) �__name__� __module__�__qualname__�__doc__r � block_size�oidr r r r$ r&