File: //lib/python3/dist-packages/nacl/bindings/__pycache__/crypto_shorthash.cpython-38.pyc
U
�֫[� � @ sp d dl mZmZmZ d dlmZ d dlmZm Z d dlm
Z
e �� Ze �
� Ze �� Ze �� Zdd� Zdd� ZdS ) � )�absolute_import�division�print_functionN)�ffi�lib)�ensurec C sb t |�tkrt�d�t���t�dt�}t� || t | �|�}t
|dktjd� t�|t�dd� S )z�Compute a fast, cryptographic quality, keyed hash of the input data
:param data:
:type data: bytes
:param key: len(key) must be equal to
:py:data:`.KEYBYTES` (16)
:type key: bytes
�$Key length must be exactly {0} bytes�unsigned char[]r �ZraisingN)
�len�KEYBYTES�exc�
ValueError�formatr �new�BYTESr �crypto_shorthash_siphash24r �RuntimeError�buffer��data�keyZdigestZrc� r �@/usr/lib/python3/dist-packages/nacl/bindings/crypto_shorthash.pyr s �r c C sb t |�tkrt�d�t���t�dt�}t� || t | �|�}t
|dktjd� t�|t�dd� S )z�Compute a fast, cryptographic quality, keyed hash of the input data
:param data:
:type data: bytes
:param key: len(key) must be equal to
:py:data:`.XKEYBYTES` (16)
:type key: bytes
r r r r
N)
r � XKEYBYTESr
r r r r �XBYTESr �crypto_shorthash_siphashx24r r r r r r r r . s �r )Z
__future__r r r Znacl.exceptions�
exceptionsr
Znacl._sodiumr r r Z crypto_shorthash_siphash24_bytesr Z#crypto_shorthash_siphash24_keybytesr Z!crypto_shorthash_siphashx24_bytesr Z$crypto_shorthash_siphashx24_keybytesr r r r r r r �<module> s