/var/opt/nydus/ops/cryptography/hazmat/primitives/ciphers/__pycache__
NameSizeModeActions
aead.cpython-312.pyc157080644editdlrm
algorithms.cpython-312.pyc89200644editdlrm
base.cpython-312.pyc132130644editdlrm
modes.cpython-312.pyc122420644editdlrm
__init__.cpython-312.pyc5750644editdlrm
Edit: /var/opt/nydus/ops/cryptography/hazmat/primitives/ciphers/__pycache__/modes.cpython-312.pyc (12242B)
O j 6ddlZddlZddlmZddlmZmZddlmZm Z ddl m Z GddejZ Gd d e ejZGd d e ejZGd de ejZGdde ejZde de ddfdZdededdfdZdedede ddfdZdede ddfdZGddeZGddeZGdde ZGd d!eZGd"d#eZGd$d%eZGd&d'eZGd(d)eeZy)*N)utils)UnsupportedAlgorithm_Reasons)BlockCipherAlgorithmCipherAlgorithm) algorithmscneZdZeej defdZej deddfdZ y)Modereturncy)z@ A string naming this mode (e.g. "ECB", "CBC"). Nselfs ]/opt/nydus/tmp/pip-target-a90h98xg/lib/python/cryptography/hazmat/primitives/ciphers/modes.pynamez Mode.name algorithmNcy)zq Checks that all the necessary invariants of this (mode, algorithm) combination are met. Nr rrs rvalidate_for_algorithmzMode.validate_for_algorithmrr) __name__ __module__ __qualname__propertyabcabstractmethodstrrrrr rrr r sQ  c     D  rr ) metaclassc@eZdZeej defdZy)ModeWithInitializationVectorr cy)zP The value of the initialization vector for this mode as bytes. Nr rs rinitialization_vectorz2ModeWithInitializationVector.initialization_vector#rrN)rrrrrrbytesr#r rrr!r!"s)  u  rr!c@eZdZeej defdZy) ModeWithTweakr cy)z@ The value of the tweak for this mode as bytes. Nr rs rtweakzModeWithTweak.tweak,rrN)rrrrrrr$r(r rrr&r&+)  u  rr&c@eZdZeej defdZy) ModeWithNoncer cy)z@ The value of the nonce for this mode as bytes. Nr rs rnoncezModeWithNonce.nonce5rrN)rrrrrrr$r-r rrr+r+4r)rr+cZeZdZeej dejefdZ y)ModeWithAuthenticationTagr cy)zP The value of the tag supplied to the constructor of this mode. Nr rs rtagzModeWithAuthenticationTag.tag>rrN) rrrrrrtypingOptionalr$r1r rrr/r/=s2  V__U+  rr/rrr cX|jdkDr|jdk(r tdyy)NAESz=Only 128, 192, and 256 bit keys are allowed for this AES mode)key_sizer ValueErrorrs r_check_aes_key_lengthr9Fs3CINNe$; K  %<rct|jdz|jk7r8tdj t|j|j y)NzInvalid IV size ({}) for {}.)lenr# block_sizer8formatrrs r_check_iv_lengthr?MsW 4 % %&*i.B.BB * 1 1D../   Crr-rct|tst|dtjt |dz|j k7r$tdjt ||y)N" requires a block cipher algorithmr;zInvalid nonce size ({}) for {}.) isinstancerrrUNSUPPORTED_CIPHERr<r=r8r>)r-rrs r_check_nonce_lengthrDXsn i!5 6"f6 7  ' '   5zA~--- - 4 4SZ F  .rct|tst|dtjt ||t ||y)NrA)rBrrrrCr9r?rs r_check_iv_and_key_lengthrFfsF i!5 6"f6 7  ' '  $ *T9%rc6eZdZdZdefdZedefdZeZ y)CBCr#c>tjd|||_yNr#r_check_byteslike_initialization_vectorrr#s r__init__z CBC.__init__u 68MN&;#rr c|jSNrMrs rr#zCBC.initialization_vectory***rN rrrrr$rOrr#rFrr rrrHrHr6 Dtjd|||_yrJrKrNs rrOz OFB.__init__rPrr c|jSrRrSrs rr#zOFB.initialization_vectorrTrNrUr rrrererVrrec6eZdZdZdefdZedefdZeZ y)CFBr#c>tjd|||_yrJrKrNs rrOz CFB.__init__rPrr c|jSrRrSrs rr#zCFB.initialization_vectorrTrNrUr rrririrVrric6eZdZdZdefdZedefdZeZ y)CFB8r#c>tjd|||_yrJrKrNs rrOz CFB8.__init__rPrr c|jSrRrSrs rr#zCFB8.initialization_vectorrTrNrUr rrrmrms6 Dtjd|||_y)Nr-)rrL_nonce)rr-s rrOz CTR.__init__s w. rr c|jSrR)rsrs rr-z CTR.noncer]rrNc^t||t|j|j|yrR)r9rDr-rrs rrzCTR.validate_for_algorithms dI.DJJ 9=r) rrrrr$rOrr-rrr rrrqrqsA Deu>>D>rrqceZdZdZdZdZ d dedejede fdZ e dejefd Z e defd Z d eddfd Zy)GCMl?lNr#r1min_tag_lengthcHtjd|t|dkst|dkDr td||_|Ntj d||dkr tdt||krtdj |||_||_y) Nr#r;zIinitialization_vector must be between 8 and 128 bytes (64 and 1024 bits).r1zmin_tag_length must be >= 4z.Authentication tag must be {} bytes or longer.) rrLr<r8rM _check_bytesr>_tag_min_tag_length)rr#r1rxs rrOz GCM.__init__s 68MN $ % )S1F-G#-M" '<# ?   uc *! !>??3x.( DKK&  -rr c|jSrR)r}rs rr1zGCM.tags yyrc|jSrRrSrs rr#zGCM.initialization_vectorrTrrc t||t|tstdtj |j dz}|j3t|j|kDrtdj|yy)Nz%GCM requires a block cipher algorithmr;z0Authentication tag cannot be more than {} bytes.) r9rBrrrrCr=r}r<r8r>)rrblock_size_bytess rrzGCM.validate_for_algorithmsdI.)%9:&7++ %//14 99 S^6F%FBII$ &G r)NrZ)rrrr_MAX_ENCRYPTED_BYTES_MAX_AAD_BYTESr$r2r3intrOrr1r#rrr rrrwrws D-!N '+ .$.__U #. .8V__U++u++  D rrw) rr2 cryptographyrcryptography.exceptionsrr/cryptography.hazmat.primitives._cipheralgorithmrr&cryptography.hazmat.primitives.ciphersrABCMetar r!r&r+r/r9r?r$rrDrFrHrXrcrerirmrqrwr rrrsV  B>  S[[   43;;  DCKK  DCKK       T  & 3G         (7      & & &3B &  & 6 & 6-:3$3 6 & 6 6 & 6 6 ' 6 >- > 6 &(A6r