3 œäL]�ã@snddlmZmZmZddljZddlmZm Z ddlm Z e j ƒZ e j ƒZe jƒZe jƒZdd„Zdd„ZdS) é)Úabsolute_importÚdivisionÚprint_functionN)ÚffiÚlib)ÚensurecCsbt|ƒtkrtjdjtƒƒ‚tjdtƒ}tj ||t|ƒ|ƒ}t |dktj d�tj |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 z$Key length must be exactly {0} byteszunsigned char[]r)ÚraisingN) ÚlenÚKEYBYTESÚexcÚ ValueErrorÚformatrÚnewÚBYTESrÚcrypto_shorthash_siphash24rÚ RuntimeErrorÚbuffer)ÚdataÚkeyÚdigestÚrc©rúB/tmp/pip-install-wfra5znf/pynacl/nacl/bindings/crypto_shorthash.pyrs   rcCsbt|ƒtkrtjdjtƒƒ‚tjdtƒ}tj ||t|ƒ|ƒ}t |dktj d�tj |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 z$Key length must be exactly {0} byteszunsigned char[]r)rN) r Ú XKEYBYTESr r r rrÚXBYTESrÚcrypto_shorthash_siphashx24rrr)rrrrrrrr.s   r)Ú __future__rrrZnacl.exceptionsÚ exceptionsr Z nacl._sodiumrrrZ crypto_shorthash_siphash24_bytesrZ#crypto_shorthash_siphash24_keybytesr Z!crypto_shorthash_siphashx24_bytesrZ$crypto_shorthash_siphashx24_keybytesrrrrrrrÚs