Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/Cryptodome/Hash/__pycache__/SHA512.cpython-39.pyc
Ðазад
a b�h4 � @ sh d dl mZ d dlmZmZmZmZmZmZm Z edd�Z G dd� de�Zddd �Z d ZdZdd � ZdS )� ��bord)�load_pycryptodome_raw_lib�VoidPointer�SmartPointer�create_string_buffer�get_raw_buffer�c_size_t�c_uint8_ptrzCryptodome.Hash._SHA512a int SHA512_init(void **shaState, size_t digest_size); int SHA512_destroy(void *shaState); int SHA512_update(void *hs, const uint8_t *buf, size_t len); int SHA512_digest(const void *shaState, uint8_t *digest, size_t digest_size); int SHA512_copy(const void *src, void *dst); int SHA512_pbkdf2_hmac_assist(const void *inner, const void *outer, const uint8_t *first_digest, uint8_t *final_digest, size_t iterations, size_t digest_size); c @ sF e Zd ZdZdZdd� Zdd� Zdd� Zd d � Zdd� Z ddd�Z d S )� SHA512Hasha� A SHA-512 hash object (possibly in its truncated version SHA-512/224 or SHA-512/256. 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 � c C s� || _ |d u rd| _d| _n4|dkr2d| _d| _n|dkrHd| _d| _ntd ��t� }t�|�� t| j��}|r|td | ��t |� � tj�| _|r�| � |� d S )Nz2.16.840.1.101.3.4.2.3�@ Z224z2.16.840.1.101.3.4.2.5� �256z2.16.840.1.101.3.4.2.6� z7Incorrect truncation length. It must be '224' or '256'.z$Error %d while instantiating SHA-512)� _truncate�oid�digest_size� ValueErrorr �_raw_sha512_libZSHA512_initZ address_ofr r �getZSHA512_destroy�_state�update)�self�data�truncate�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/SHA512.py�__init__E s0 ���zSHA512Hash.__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. z'Error %d while hashing data with SHA512N)r Z SHA512_updater r r r �lenr )r r r r r r r _ s ��zSHA512Hash.updatec C s<