U
    cc                     @   s   U d dl mZ d dlmZmZ d dlmZ e Z	e
ed< e Ze
ed< e Ze
ed< eeddd	Zeedd
dZeedddZdS )    )
exceptions)ffilib)ensurecrypto_hash_BYTEScrypto_hash_sha256_BYTEScrypto_hash_sha512_BYTES)messagereturnc                 C   sF   t dt}t|| t| }t|dkdtjd t 	|tdd S zb
    Hashes and returns the message ``message``.

    :param message: bytes
    :rtype: bytes
    zunsigned char[]r   zUnexpected library error)ZraisingN)
r   newr   r   crypto_hashlenr   excRuntimeErrorbufferr	   digestrc r   =/tmp/pip-unpacked-wheel-e6sdgn5m/nacl/bindings/crypto_hash.pyr      s    r   c                 C   sF   t dt}t|| t| }t|dkdtjd t 	|tdd S r   )
r   r   r   r   crypto_hash_sha256r   r   r   r   r   r   r   r   r   r   (   s    r   c                 C   sF   t dt}t|| t| }t|dkdtjd t 	|tdd S r   )
r   r   r   r   crypto_hash_sha512r   r   r   r   r   r   r   r   r   r   5   s    r   N)Znaclr   r   Znacl._sodiumr   r   Znacl.exceptionsr   Zcrypto_hash_sha512_bytesr   int__annotations__Zcrypto_hash_sha256_bytesr   r   bytesr   r   r   r   r   r   r   <module>   s    