a b@sUddlmZddlmZmZddlmZeZ e e d<e Z e e d<eZe e d<eeddd Zeedd d Zeedd d ZdS)) exceptions)ffilib)ensurecrypto_hash_BYTEScrypto_hash_sha256_BYTEScrypto_hash_sha512_BYTES)messagereturncCsFtdt}t||t|}t|dkdtjdt |tddSzb Hashes and returns the message ``message``. :param message: bytes :rtype: bytes zunsigned char[]rzUnexpected library error)ZraisingN) rnewrr crypto_hashlenrexc RuntimeErrorbufferr digestrcr@/tmp/pip-target-98j97qn4/lib/python/nacl/bindings/crypto_hash.pyr s r cCsFtdt}t||t|}t|dkdtjdt |tddSr ) rr rrcrypto_hash_sha256rrrrrrrrrr(s rcCsFtdt}t||t|}t|dkdtjdt |tddSr ) rr rrcrypto_hash_sha512rrrrrrrrrr5s rN)ZnaclrrZ nacl._sodiumrrZnacl.exceptionsrZcrypto_hash_sha512_bytesrint__annotations__Zcrypto_hash_sha256_bytesrrbytesr rrrrrrs