ó 9(Zc@`sĄddlmZmZmZddlZddlmZddlmZm Z m Z m Z ddl m Z ddlmZddlmZejdZejeƒd efd „ƒYƒZdS( i(tabsolute_importtdivisiontprint_functionN(tutils(tAlreadyFinalizedt InvalidKeytUnsupportedAlgorithmt_Reasons(t ScryptBackend(t constant_time(tKeyDerivationFunctionitScryptcB`s#eZd„Zd„Zd„ZRS(cC`sźt|tƒs$tdtjƒ‚n||_t|tƒsKtdƒ‚n|dksk||d@dkrztdƒ‚n|dkr•tdƒ‚n|dkr°tdƒ‚nt |_ ||_ ||_ ||_ ||_||_dS( Ns0Backend object does not implement ScryptBackend.ssalt must be bytes.iiis-n must be greater than 1 and be a power of 2.s%r must be greater than or equal to 1.s%p must be greater than or equal to 1.(t isinstanceRRRtBACKEND_MISSING_INTERFACEt_lengthtbytest TypeErrort ValueErrortFalset_usedt_saltt_nt_rt_pt_backend(tselftsalttlengthtntrtptbackend((sO/tmp/pip-build-wDUJoH/cryptography/cryptography/hazmat/primitives/kdf/scrypt.pyt__init__s&         cC`sm|jrtdƒ‚nt|_t|tƒs?tdƒ‚n|jj||j|j |j |j |j ƒS(Ns'Scrypt instances can only be used once.skey_material must be bytes.( RRtTrueR RRRt derive_scryptRRRRR(Rt key_material((sO/tmp/pip-build-wDUJoH/cryptography/cryptography/hazmat/primitives/kdf/scrypt.pytderive4s   cC`s4|j|ƒ}tj||ƒs0tdƒ‚ndS(NsKeys do not match.(R$R tbytes_eqR(RR#t expected_keyt derived_key((sO/tmp/pip-build-wDUJoH/cryptography/cryptography/hazmat/primitives/kdf/scrypt.pytverify?s(t__name__t __module__R R$R((((sO/tmp/pip-build-wDUJoH/cryptography/cryptography/hazmat/primitives/kdf/scrypt.pyR s  (t __future__RRRtsyst cryptographyRtcryptography.exceptionsRRRRt'cryptography.hazmat.backends.interfacesRtcryptography.hazmat.primitivesR t"cryptography.hazmat.primitives.kdfR tmaxsizet _MEM_LIMITtregister_interfacetobjectR (((sO/tmp/pip-build-wDUJoH/cryptography/cryptography/hazmat/primitives/kdf/scrypt.pyts "