3 L]@snddlmZmZmZddljZddlmZm Z ddlm Z e j Z e j Ze jZe jZddZddZdS) )absolute_importdivisionprint_functionN)ffilib)ensurecCsbt|tkrtjdjttjdt}tj ||t||}t |dktj dtj |tddS)zCompute 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) lenKEYBYTESexc ValueErrorformatrnewBYTESrcrypto_shorthash_siphash24r RuntimeErrorbuffer)datakeydigestrcrB/tmp/pip-install-wfra5znf/pynacl/nacl/bindings/crypto_shorthash.pyrs   rcCsbt|tkrtjdjttjdt}tj ||t||}t |dktj dtj |tddS)zCompute 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 rrXBYTESrcrypto_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_keybytesrrrrrrrs