HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/python3/dist-packages/cryptography/hazmat/backends/openssl/__pycache__/hashes.cpython-38.pyc
U

�e�]|�@s\ddlmZmZmZddlmZddlmZmZddl	m
Z
e�e
j�Gdd�de
��ZdS)�)�absolute_import�division�print_function)�utils)�UnsupportedAlgorithm�_Reasons)�hashesc@s@eZdZd
dd�Ze�d�Zdd�Zdd�Zd	d
�Z	dd�Z
dS)�_HashContextNcCs�||_||_|dkr�|jj��}|jj�||jjj�}|j�|�}||jjjkrdt	d�
|j�tj
��|jj�|||jjj�}|j�|dk�||_dS)Nz+{} is not a supported hash on this backend.r)�
_algorithm�_backend�_lib�Cryptography_EVP_MD_CTX_new�_ffi�gc�Cryptography_EVP_MD_CTX_freeZ_evp_md_from_algorithmZNULLr�format�namerZUNSUPPORTED_HASHZEVP_DigestInit_ex�openssl_assert�_ctx)�selfZbackend�	algorithm�ctxZevp_md�res�r�M/usr/lib/python3/dist-packages/cryptography/hazmat/backends/openssl/hashes.py�__init__s*����z_HashContext.__init__r
cCsV|jj��}|jj�||jjj�}|jj�||j�}|j�|dk�t	|j|j
|d�S)Nr)r)rrr
rrrZEVP_MD_CTX_copy_exrrr	r)rZ
copied_ctxrrrr�copy(s�z_HashContext.copycCs:|jj�|�}|jj�|j|t|��}|j�|dk�dS)Nr)rrZfrom_bufferrZEVP_DigestUpdater�lenr)r�dataZdata_ptrrrrr�update1s�z_HashContext.updatecCs�t|jtj�r|��S|jj�d|jjj	�}|jj�d�}|jj�
|j||�}|j�|dk�|j�|d|jj
k�|jj�|�d|d�SdS)N�unsigned char[]zunsigned int *r)�
isinstancerrZExtendableOutputFunction�
_finalize_xofrr�newrZEVP_MAX_MD_SIZEZEVP_DigestFinal_exrr�digest_size�buffer)r�bufZoutlenrrrr�finalize8s
��z_HashContext.finalizecCsV|jj�d|jj�}|jj�|j||jj�}|j�|dk�|jj�	|�d|jj�S)Nr r)
rrr#rr$rZEVP_DigestFinalXOFrrr%)rr&rrrrr"Gs
��z_HashContext._finalize_xof)N)�__name__�
__module__�__qualname__rrZread_only_propertyrrrr'r"rrrrr	
s

	r	N)Z
__future__rrrZcryptographyrZcryptography.exceptionsrrZcryptography.hazmat.primitivesrZregister_interfaceZHashContext�objectr	rrrr�<module>s