관리-도구
편집 파일: BLAKE2s.cpython-311.pyc
� O�Dg�$ � � � d dl mZ d dlmZmZ d dlmZ d dlmZm Z m Z mZmZm Z mZ edd� � Z G d� de� � Zd � Zd S )� )� unhexlify)�bord�tobytes)�get_random_bytes)�load_pycryptodome_raw_lib�VoidPointer�SmartPointer�create_string_buffer�get_raw_buffer�c_size_t�c_uint8_ptrzCrypto.Hash._BLAKE2sa� int blake2s_init(void **state, const uint8_t *key, size_t key_size, size_t digest_size); int blake2s_destroy(void *state); int blake2s_update(void *state, const uint8_t *buf, size_t len); int blake2s_digest(const void *state, uint8_t digest[32]); int blake2s_copy(const void *src, void *dst); c �@ � e Zd ZdZdZd� Zd� Zd� Zd� Zd� Z d� Z d � Zd S )�BLAKE2s_Hasha� A BLAKE2s 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 � c � � || _ || _ d| _ |dv r|sdt |� � z | _ t � � }t � |� � � t |� � t t |� � � � t |� � � � }|rt d|z � � �t |� � � t j � � | _ |r| � |� � d S d S )NF)� � � r z1.3.6.1.4.1.1722.12.2.2.z$Error %d while instantiating BLAKE2s)�digest_size�_update_after_digest�_digest_done�str�oidr �_raw_blake2s_lib�blake2s_init� address_ofr r �len� ValueErrorr �get�blake2s_destroy�_state�update)�self�data�key�digest_bytes�update_after_digest�state�results �u/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib64/python3.11/site-packages/Crypto/Hash/BLAKE2s.py�__init__zBLAKE2s_Hash.__init__L s � � (���$7��!�!��� �+�+�+�C�+�1�C��4E�4E�E�D�H�� � ��!�.�.�u�/?�/?�/A�/A�/:�3�/?�/?�/7��C���/A�/A�/7��/E�/E�1� 1�� � N��C�f�L�M�M�M�"�5�9�9�;�;�#3�#C�E� E���� ��K�K������� � � c � � | j r| j st d� � �t � | j � � � t |� � t t |� � � � � � }|rt d|z � � �| 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 objectz#Error %d while hashing BLAKE2s data)r r � TypeErrorr �blake2s_updater! r r r r r )r# r$ r) s r* r"