Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/Crypto/Hash/__pycache__/MD4.cpython-39.pyc
Ðазад
a c�h� � @ sh d Z ddlmZ ddlmZmZmZmZmZm Z m Z edd�ZG dd� de�Z dd d �Ze jZe jZdS )a� MD4 is specified in RFC1320_ and produces the 128 bit digest of a message. >>> from Crypto.Hash import MD4 >>> >>> h = MD4.new() >>> h.update(b'Hello') >>> print h.hexdigest() MD4 stand for Message Digest version 4, and it was invented by Rivest in 1990. This algorithm is insecure. Do not use it for new designs. .. _RFC1320: http://tools.ietf.org/html/rfc1320 � ��bord)�load_pycryptodome_raw_lib�VoidPointer�SmartPointer�create_string_buffer�get_raw_buffer�c_size_t�c_uint8_ptrzCrypto.Hash._MD4a� int md4_init(void **shaState); int md4_destroy(void *shaState); int md4_update(void *hs, const uint8_t *buf, size_t len); int md4_digest(const void *shaState, uint8_t digest[20]); int md4_copy(const void *src, void *dst); c @ sP e Zd ZdZdZdZdZddd�Zdd � Zd d� Z dd � Z dd� Zddd�ZdS )�MD4Hashz&Class that implements an MD4 hash � �@ z1.2.840.113549.2.4Nc C sH t � }t�|�� �}|r$td| ��t|�� tj�| _|rD| � |� d S )N� Error %d while instantiating MD4) r �_raw_md4_libZmd4_initZ address_of� ValueErrorr �getZmd4_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/MD4.py�__init__O s ��zMD4Hash.__init__c C s4 t �| j�� t|�tt|���}|r0td| ��dS )a� Continue hashing of a message by consuming the next chunk of data. Repeated calls are equivalent to a single call with the concatenation of all the arguments. In other words: >>> m.update(a); m.update(b) is equivalent to: >>> m.update(a+b) :Parameters: data : byte string/byte array/memoryview The next chunk of the message being hashed. r N)r Z md4_updater r r r �lenr )r r r r r r r Z s ��zMD4Hash.updatec C s4 t | j�}t�| j�� |�}|r,td| ��t|�S )ar Return the **binary** (non-printable) digest of the message that has been hashed so far. This method does not change the state of the hash object. You can continue updating the object after calling this function. :Return: A byte string of `digest_size` bytes. It may contain non-ASCII characters, including null bytes. r )r �digest_sizer Z md4_digestr r r r )r Zbfrr r r r �digestr s ��zMD4Hash.digestc C s d� dd� | �� D ��S )a Return the **printable** digest of the message that has been hashed so far. This method does not change the state of the hash object. :Return: A string of 2* `digest_size` characters. It contains only hexadecimal ASCII digits. � c S s g | ]}d t |� �qS )z%02xr )�.0�xr r r � <listcomp>� � z%MD4Hash.hexdigest.<locals>.<listcomp>)�joinr )r r r r � hexdigest� s zMD4Hash.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 zError %d while copying MD4)r r Zmd4_copyr r r )r �cloner r r r �copy� s �zMD4Hash.copyc C s t |�S )N)r )r r r r r �new� s zMD4Hash.new)N)N) �__name__� __module__�__qualname__�__doc__r � block_size�oidr r r r$ r&