3 L]@spddlmZmZmZddlmZddlmZm Z ddl m Z e j Z e jZe j ZddZddZd d Zd S) )absolute_importdivisionprint_function) exceptions)ffilib)ensurecCsFtjdt}tj||t|}t|dkdtjdtj |tddS)zb Hashes and returns the message ``message``. :param message: bytes :rtype: bytes zunsigned char[]rzUnexpected library error)raisingN) rnewcrypto_hash_BYTESr crypto_hashlenrexc RuntimeErrorbuffer)messagedigestrcr=/tmp/pip-install-wfra5znf/pynacl/nacl/bindings/crypto_hash.pyr s   r cCsFtjdt}tj||t|}t|dkdtjdtj |tddS)zb Hashes and returns the message ``message``. :param message: bytes :rtype: bytes zunsigned char[]rzUnexpected library error)r N) rr crypto_hash_sha256_BYTESrcrypto_hash_sha256r rrrr)rrrrrrr+s   rcCsFtjdt}tj||t|}t|dkdtjdtj |tddS)zb Hashes and returns the message ``message``. :param message: bytes :rtype: bytes zunsigned char[]rzUnexpected library error)r N) rr crypto_hash_sha512_BYTESrcrypto_hash_sha512r rrrr)rrrrrrr:s   rN) __future__rrrZnaclrrZ nacl._sodiumrrZnacl.exceptionsrZcrypto_hash_sha512_bytesr Zcrypto_hash_sha256_bytesrrr rrrrrrs