3Tf(ddlmZddlZddlZddlZddlZddlZGddeZeZ eZ eZ eZ ddZ ddZdddZddZGd d eZGd d ZGd dej(Z d ddZddZGddej0Zy)) annotationsNc eZdZy)CryptographyDeprecationWarningN__name__ __module__ __qualname__4/usr/lib/python3/dist-packages/cryptography/utils.pyrrr rc@t|tst|dy)Nz must be bytes) isinstancebytes TypeErrornamevalues r _check_bytesrs# eU #4&/00 $r cR t|y#t$rt|dwxYw)Nz must be bytes-like) memoryviewrrs r _check_bytesliker"s165 64& 34556s &c^|j|xs|jdzdzxsddS)Nbig)to_bytes bit_length)integerlengths r int_to_bytesr")s7   67%%'!+16Q r cddlm}|jj|}|t |jj d|fS)Nr)_openssl uintptr_t)"cryptography.hazmat.bindings._rustr$ffi from_bufferintcast)objr$bufs r _extract_buffer_lengthr-/s:; ,, " "3 'C HLL%%k378 88r c eZdZy)InterfaceNotImplementedNrr r r r/r/6r r r/ceZdZddZy)_DeprecatedValuec.||_||_||_yN)rmessage warning_class)selfrr4r5s r __init__z_DeprecatedValue.__init__;s  *r N)robjectr4str)rrr r7r r r r1r1:s+r r1c@eZdZdfd ZddZddZd dZd dZxZS) _ModuleWithDeprecationscVt||j||jd<yN_module)superr7r__dict__)r6module __class__s r r7z _ModuleWithDeprecations.__init__Bs" )#) i r ct|j|}t|tr8t j |j |jd|j}|SN) stacklevel) getattrr>rr1warningswarnr4r5rr6attrr+s r __getattr__z#_ModuleWithDeprecations.__getattr__FsEdllD) c+ , MM#++s'8'8Q G))C r c2t|j||yr3)setattrr>)r6rKrs r __setattr__z#_ModuleWithDeprecations.__setattr__Ms dE*r ct|j|}t|tr,t j |j |jdt|j|yrD) rGr>rr1rHrIr4r5delattrrJs r __delattr__z#_ModuleWithDeprecations.__delattr__PsEdllD) c+ , MM#++s'8'8Q G d#r c4dgt|jzSr=)dirr>r6s r __dir__z_ModuleWithDeprecations.__dir__Ws{S...r )rAztypes.ModuleType)rKr9returnr8)rKr9rr8rWNone)rKr9rWrX)rWztyping.Sequence[str]) rrr r7rLrOrRrV __classcell__)rBs@r r;r;As*+$/r r;ctj|}t|tst|xtj|<}t |||}| t ||||Sr3)sysmodulesrr;r1rN)r module_namer4r5rrAdvs r deprecatedr_[sZ[[ %F f5 6,CF,KK K 6 %- 8B b! Ir cLdtdfd }t|S)N_cached_cXt|}|ur|S|}t|||Sr3)rGrN)instancecacheresult cached_namefuncsentinels r innerzcached_property..innerps8+x8  Lh+v. r )rcr8)r8property)rgrirfrhs` @@r cached_propertyrkls'TF#KxH E?r ceZdZddZddZy)Enumcjd|jjd|jd|jdS)N<.z: >)rBr_name__value_rUs r __repr__z Enum.__repr__~s14>>**+1T[[MDLL;K1MMr cL|jjd|jS)Nrp)rBrrrrUs r __str__z Enum.__str__s"..))*!DKK=99r N)rWr9)rrr rtrvr r r rmrm}s N:r rm)rr9rrrWrXr3)r r)r!ztyping.Optional[int]rWr)r+z typing.AnyrWztyping.Tuple[typing.Any, int]) rr8r]r9r4r9r5ztyping.Type[Warning]rztyping.Optional[str]rWr1)rgztyping.CallablerWrj) __future__renumr[typestypingrH UserWarningrDeprecatedIn36DeprecatedIn37DeprecatedIn40DeprecatedIn41rrr"r- Exceptionr/r1 ModuleTyper;r_rkrmr r r rs #   [ 0///1 6 9 i ++/e../>"&  (     " ":499:r