/var/opt/nydus/ops/oscrypto/__pycache__
NameSizeModeActions
asymmetric.cpython-312.pyc117610644editdlrm
errors.cpython-312.pyc34960644editdlrm
kdf.cpython-312.pyc83310644editdlrm
keys.cpython-312.pyc7080644editdlrm
symmetric.cpython-312.pyc10880644editdlrm
tls.cpython-312.pyc6220644editdlrm
trust_list.cpython-312.pyc134620644editdlrm
util.cpython-312.pyc19390644editdlrm
version.cpython-312.pyc3650644editdlrm
_asn1.cpython-312.pyc21380644editdlrm
_asymmetric.cpython-312.pyc320300644editdlrm
_cipher_suites.cpython-312.pyc222960644editdlrm
_ecdsa.cpython-312.pyc222560644editdlrm
_errors.cpython-312.pyc12870644editdlrm
_ffi.cpython-312.pyc170820644editdlrm
_int.cpython-312.pyc9780644editdlrm
_pkcs1.cpython-312.pyc210960644editdlrm
_pkcs5.cpython-312.pyc41870644editdlrm
_pkcs12.cpython-312.pyc57770644editdlrm
_rand.cpython-312.pyc14390644editdlrm
_tls.cpython-312.pyc173070644editdlrm
_types.cpython-312.pyc14140644editdlrm
__init__.cpython-312.pyc99950644editdlrm
Edit: /var/opt/nydus/ops/oscrypto/__pycache__/kdf.cpython-312.pyc (8331B)
N j>ddlmZmZmZmZddlZddlZddlmZddlm Z ddl m Z ddl m Z mZmZddlmZdd lmZmZe Zed k(r dd lmZmZn#ed k(sed k(rdd lmZmZddlmZmZndd lmZmZgdZej>dk(rdZ dZ!ndZ dZ!ddZ"dZ#y))unicode_literalsdivisionabsolute_importprint_functionN)datetime)backend) rand_bytes) type_namebyte_cls int_types)pretty_message)newderefmac)pbkdf2 pkcs12_kdfwin winlegacy)kernel32 handle_error)pbkdf1rpbkdf2_iteration_calculatorrwin32cxttd}tj|}t|t |S)NzLARGE_INTEGER *)rrQueryPerformanceCounterrr)numberress =/opt/nydus/tmp/pip-target-a90h98xg/lib/python/oscrypto/kdf.py _get_startr $s1X01..v6SV}c8t|z }t|dz S)Ng@@)r int)startlengths r _get_elapsedr&*s%6F?##r!c*tjS)N)rnowr!rr r /s||~r!ctj|z }|j|jdzdzz}|jdz }t ||dzzS)Nii)rr(secondsdays microsecondsr#)r$r%r, millisecondss rr&r&2sS%'..FKK"$4t$;<++g5 <7W#4566r!c tgdvrttdtt t st tdtdkrttdtt t st tdtdkrttdttjrttdd d jd  t   fd }|}t|z d z |}|z dkrdnd}tt|}|dkDr|dzdz}|S)a Runs pbkdf2() twice to determine the approximate number of iterations to use to hit a desired time per run. Use this on a production machine to dynamically adjust the number of iterations as high as you can. :param hash_algorithm: The string name of the hash algorithm to use: "md5", "sha1", "sha224", "sha256", "sha384", "sha512" :param key_length: The length of the desired key in bytes :param target_ms: The number of milliseconds the derivation should take :param quiet: If no output should be printed as attempts are made :return: An integer number of iterations of PBKDF2 using the specified hash that will take at least target_ms )sha1sha224sha256sha384sha512zz hash_algorithm must be one of "sha1", "sha224", "sha256", "sha384", "sha512", not %s ? key_length must be an integer, not %s rC key_length must be greater than 0 - is %s z> target_ms must be an integer, not %s zB target_ms must be greater than 0 - is %s z Only a very slow, pure-python version of PBKDF2 is available, making this function useless i'zthis is a testzutf-8ct}tt|}std|ddz |zS)Nz iterations in msg?)r rr&print) r$ observed_mshash_algorithm iterations key_lengthpasswordquietsalt target_mss r_measurez-pbkdf2_iteration_calculator.._measuresC ~xz:F"5)  ZE FY,,r!g@ii Ni)set ValueErrorrrepr isinstancer TypeErrorr r pure_pythonOSErrorencoder r#round) r<r>rBr@rCfraction round_factorresultr=r?rAs ```` @@@rrr9s0S!QRR       j) ,  j !    A~        i +  i    1}  O    n    J&&w/H j !D--zHZ(*S01JzHh&J $f,2"L z<0 1F ~D.D( Mr!c t|tsttdt |t|tsttdt |t|t sttdt ||dkrt tdt|t|t sttdt ||dkrt tdt||tgdvrt td t||d kDr/|td d gvr t td |t|f|dkDr#|dk(rt tdt|tt|}|||zj}td|dzD]}||j}|d|S)aF An implementation of PBKDF1 - should only be used for interop with legacy systems, not new architectures :param hash_algorithm: The string name of the hash algorithm to use: "md2", "md5", "sha1" :param password: A byte string of the password to use an input to the KDF :param salt: A cryptographic random byte string :param iterations: The numbers of iterations to use when deriving the key :param key_length: The length of the desired key in bytes :return: The derived key as a byte string z@ password must be a byte string, not %s z< salt must be a byte string, not %s z? iterations must be an integer, not %s rzC iterations must be greater than 0 - is %s r6r7)md2md5r1zT hash_algorithm must be one of "md2", "md5", "sha1", not %s rSrTzM key_length can not be longer than 16 for %s - is %s r1zO key_length can not be longer than 20 for sha1 - is %s N) rIr rJrr r rGrHrFgetattrhashlibdigestrange)r<r?rAr=r>algooutput_s rrrs0 h ) x     dH % t_     j) , z "    A~        j) , z "    A~       S!788      B>S%-@@ T*- .    B>V3        7N +D (T/ " ) ) +F 1j1n %f$$&& +: r!)dF)$ __future__rrrrsysrYrr utilr _typesr r r _errorsr_ffirr_backend _mac.utilrr _win.util_win._kernel32rr _openssl.util__all__platformr r&rrr)r!rrnsRR 22# 9 u-- (k1-661 <<7 $ 7dNer!