File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/Cryptodome/Hash/__pycache__/SHA224.cpython-310.pyc
Back
o ;j � @ sl d dl mZ d dlmZmZmZmZmZmZm Z edd�Z G dd� de�Zddd �Z ejZejZd d� ZdS ) � ��bord)�load_pycryptodome_raw_lib�VoidPointer�SmartPointer�create_string_buffer�get_raw_buffer�c_size_t�c_uint8_ptrzCryptodome.Hash._SHA224a� int SHA224_init(void **shaState); int SHA224_destroy(void *shaState); int SHA224_update(void *hs, const uint8_t *buf, size_t len); int SHA224_digest(const void *shaState, uint8_t *digest, size_t digest_size); int SHA224_copy(const void *src, void *dst); int SHA224_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 @ sP e Zd ZdZdZdZdZddd�Zdd � Zd d� Z dd � Z dd� Zddd�ZdS )� SHA224Hasha� A SHA-224 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 � �@ z2.16.840.1.101.3.4.2.4Nc C sL t � }t�|�� �}|rtd| ��t|�� tj�| _|r$| � |� d S d S )Nz#Error %d while instantiating SHA224) r �_raw_sha224_libZSHA224_initZ address_of� ValueErrorr �getZSHA224_destroy�_state�update)�self�data�state�result� r �J/opt/saltstack/salt/lib/python3.10/site-packages/Cryptodome/Hash/SHA224.py�__init__H s ���zSHA224Hash.__init__c C s4 t �| j�� t|�tt|���}|rtd| ��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 SHA224N)r Z SHA224_updater r r r �lenr )r r r r r r r S s ���zSHA224Hash.updatec C s<