U q`@spddlmZmZmZddlmZddlmZm Z ddl m Z e Z e Ze ZddZddZd d Zd S) )absolute_importdivisionprint_function) exceptions)ffilib)ensurecCsFtdt}t||t|}t|dkdtjdt |tddSzb Hashes and returns the message ``message``. :param message: bytes :rtype: bytes zunsigned char[]rzUnexpected library error)ZraisingN) rnewcrypto_hash_BYTESr crypto_hashlenrexc RuntimeErrorbuffermessagedigestrcr@/tmp/pip-target-nv4zd3e_/lib/python/nacl/bindings/crypto_hash.pyr s r cCsFtdt}t||t|}t|dkdtjdt |tddSr ) rr crypto_hash_sha256_BYTESrcrypto_hash_sha256r rrrrrrrrr+s rcCsFtdt}t||t|}t|dkdtjdt |tddSr ) rr crypto_hash_sha512_BYTESrcrypto_hash_sha512r rrrrrrrrr:s rN) __future__rrrZnaclrrZ nacl._sodiumrrZnacl.exceptionsrZcrypto_hash_sha512_bytesr Zcrypto_hash_sha256_bytesrrr rrrrrrs