ó Û_e[c@`s ddlmZmZmZddlZddlZddlmZej j Z ej j Z ej jZej jZej jZej jZej jZej jZej jZej jZej jZej j Z!de"fd„ƒYZ#ddd d dd d „Z$dS(i(tabsolute_importtdivisiontprint_functionN(tbytes_as_stringtblake2bcB`seZdZeZeZeZe Z dedddd„Z e d„ƒZ e d„ƒZe d„ƒZd„Zd„Zd„Zd „ZRS( sK :py:mod:`hashlib` API compatible blake2b algorithm implementation tc C`sGtd|d|d|d|ƒ|_||_|rC|j|ƒndS(sc :py:class:`.blake2b` algorithm initializer :param data: :type data: bytes :param int digest_size: the requested digest size; must be at most :py:attr:`.MAX_DIGEST_SIZE`; the default digest size is :py:data:`.BYTES` :param key: the key to be set for keyed MAC/PRF usage; if set, the key must be at most :py:data:`.KEYBYTES_MAX` long :type key: bytes :param salt: an initialization salt at most :py:attr:`.SALT_SIZE` long; it will be zero-padded if needed :type salt: bytes :param person: a personalization string at most :py:attr:`.PERSONAL_SIZE` long; it will be zero-padded if needed :type person: bytes tkeytsalttpersont digest_sizeN(t _b2b_initt_statet _digest_sizetupdate(tselftdataR RRR((s./tmp/pip-install-KP2Jbq/pynacl/nacl/hashlib.pyt__init__.s   cC`s|jS(N(R (R((s./tmp/pip-install-KP2Jbq/pynacl/nacl/hashlib.pyR LscC`sdS(Ni€((R((s./tmp/pip-install-KP2Jbq/pynacl/nacl/hashlib.pyt block_sizePscC`sdS(NR((R((s./tmp/pip-install-KP2Jbq/pynacl/nacl/hashlib.pytnameTscC`st|j|ƒdS(N(t _b2b_updateR (RR((s./tmp/pip-install-KP2Jbq/pynacl/nacl/hashlib.pyR XscC`s%tjj|jƒ}t||jƒS(N(tnacltbindingst%crypto_generichash_blake2b_state_copyR t _b2b_finalR (Rt_st((s./tmp/pip-install-KP2Jbq/pynacl/nacl/hashlib.pytdigest[scC`sttj|jƒƒƒS(N(RtbinasciithexlifyR(R((s./tmp/pip-install-KP2Jbq/pynacl/nacl/hashlib.pyt hexdigest_scC`s4t|ƒd|jƒ}t|jƒ}||_|S(NR (ttypeR t _b2b_copyR (Rt_cpR((s./tmp/pip-install-KP2Jbq/pynacl/nacl/hashlib.pytcopybs (t__name__t __module__t__doc__tBYTEStMAX_DIGEST_SIZEt KEYBYTES_MAXt MAX_KEY_SIZEt PERSONALBYTESt PERSON_SIZEt SALTBYTESt SALT_SIZERtpropertyR RRR RRR (((s./tmp/pip-install-KP2Jbq/pynacl/nacl/hashlib.pyR%s    Riiiiii@c C`s(tjj|||||d|d|ƒS(sž Derive a cryptographic key using the scrypt KDF. Implements the same signature as the ``hashlib.scrypt`` implemented in cpython version 3.6 tmaxmemtdklen(RRt%crypto_pwhash_scryptsalsa208sha256_ll(tpasswordRtntrtpR-R.((s./tmp/pip-install-KP2Jbq/pynacl/nacl/hashlib.pytscryptis ii(%t __future__RRRRt nacl.bindingsRt nacl.utilsRRtcrypto_generichash_BYTESR$tcrypto_generichash_BYTES_MINt BYTES_MINtcrypto_generichash_BYTES_MAXt BYTES_MAXtcrypto_generichash_KEYBYTEStKEYBYTEStcrypto_generichash_KEYBYTES_MINt KEYBYTES_MINtcrypto_generichash_KEYBYTES_MAXR&tcrypto_generichash_SALTBYTESR*t crypto_generichash_PERSONALBYTESR(tcrypto_generichash_blake2b_initR t crypto_generichash_blake2b_finalRRRt!crypto_generichash_blake2b_updateRtobjectRR4(((s./tmp/pip-install-KP2Jbq/pynacl/nacl/hashlib.pyts$              D