Viewing File: /usr/lib64/python2.7/site-packages/cryptography/hazmat/primitives/kdf/kbkdf.pyc

ó
Àb‹Xc@`sÿddlmZmZmZddlmZddlmZddlm	Z	ddl
mZmZm
Z
mZddlmZddlmZmZmZddlmZd	efd
„ƒYZdefd„ƒYZe	jeƒd
efd„ƒYƒZdS(i(tabsolute_importtdivisiontprint_function(tEnum(trange(tutils(tAlreadyFinalizedt
InvalidKeytUnsupportedAlgorithmt_Reasons(tHMACBackend(t
constant_timethashesthmac(tKeyDerivationFunctiontModecB`seZdZRS(tctr(t__name__t
__module__tCounterMode(((sN/usr/lib64/python2.7/site-packages/cryptography/hazmat/primitives/kdf/kbkdf.pyRstCounterLocationcB`seZdZdZRS(tbefore_fixedtafter_fixed(RRtBeforeFixedt
AfterFixed(((sN/usr/lib64/python2.7/site-packages/cryptography/hazmat/primitives/kdf/kbkdf.pyRst	KBKDFHMACcB`s5eZd„Zd„Zd„Zd„Zd„ZRS(c	C`s	t|
tƒs$tdtjƒ‚nt|tjƒsKtdtjƒ‚n|
j|ƒsotdtjƒ‚nt|t	ƒst
dƒ‚nt|tƒs«t
dƒ‚n|s·|rÌ|	rÌtdƒ‚n|dksè|j|ƒr÷tdƒ‚n|dkr|	dkrtdƒ‚n|dk	rIt|tƒrIt
d	ƒ‚n|dkr^d
}n|dkrsd
}nt|tƒs“t|tƒr¢t
dƒ‚n||_||_||_||_||_||_||_||_|
|_t|_|	|_dS(Ns.Backend object does not implement HMACBackend.s5Algorithm supplied is not a supported hash algorithm.s5Algorithm supplied is not a supported hmac algorithm.smode must be of type Modes(location must be of type CounterLocations9When supplying fixed data, label and context are ignored.srlen must be between 1 and 4sPlease specify an llensllen must be an integerts'label and context must be of type bytes(t
isinstanceR
RR	tBACKEND_MISSING_INTERFACERt
HashAlgorithmtUNSUPPORTED_HASHthmac_supportedRt	TypeErrorRt
ValueErrortNonet_valid_byte_lengthtinttbytest
_algorithmt_modet_lengtht_rlent_llent	_locationt_labelt_contextt_backendtFalset_usedt_fixed_data(tselft	algorithmtmodetlengthtrlentllentlocationtlabeltcontexttfixedtbackend((sN/usr/lib64/python2.7/site-packages/cryptography/hazmat/primitives/kdf/kbkdf.pyt__init__sT												cC`sZt|tƒstdƒ‚ntjd|ƒ}dt|ƒkoMdknsVtStS(Nsvalue must be of type intii(RR$R Rtint_to_bytestlenR/tTrue(R2tvaluet	value_bin((sN/usr/lib64/python2.7/site-packages/cryptography/hazmat/primitives/kdf/kbkdf.pyR#\s"cC`sm|jrt‚nt|tƒs0tdƒ‚nt|_|j|jj}dg}t	j
d|jƒ}|tdt
|ƒdƒdkržtdƒ‚nx¸td|dƒD]£}tj||jd|jƒ}t	j
||jƒ}|jtjkr
|j|ƒn|j|jƒƒ|jtjkrB|j|ƒn|j|jƒƒq²Wdj|ƒ|j S(Nskey_material must be bytesRiiisThere are too many iterations.R<(R0RRR%R R@R(R&tdigest_sizeRR>R)tpowR?R!RR
tHMACR.R+RRtupdatet_generate_fixed_inputRtappendtfinalizetjoin(R2tkey_materialtroundstoutputtr_bintithtcounter((sN/usr/lib64/python2.7/site-packages/cryptography/hazmat/primitives/kdf/kbkdf.pytderivees(				#cC`s]|jr"t|jtƒr"|jStj|jd|jƒ}dj|jd|j	|gƒS(NiRt(
R1RR%RR>R(R*RJR,R-(R2tl((sN/usr/lib64/python2.7/site-packages/cryptography/hazmat/primitives/kdf/kbkdf.pyRGŠscC`s(tj|j|ƒ|ƒs$t‚ndS(N(Rtbytes_eqRRR(R2RKtexpected_key((sN/usr/lib64/python2.7/site-packages/cryptography/hazmat/primitives/kdf/kbkdf.pytverify’s(RRR=R#RRRGRW(((sN/usr/lib64/python2.7/site-packages/cryptography/hazmat/primitives/kdf/kbkdf.pyRs
	=			%	N(t
__future__RRRtenumRt	six.movesRtcryptographyRtcryptography.exceptionsRRRR	t'cryptography.hazmat.backends.interfacesR
tcryptography.hazmat.primitivesRRR
t"cryptography.hazmat.primitives.kdfRRRtregister_interfacetobjectR(((sN/usr/lib64/python2.7/site-packages/cryptography/hazmat/primitives/kdf/kbkdf.pyt<module>s"
Back to Directory File Manager