+
    i~                        ^ RI Ht ^ RIt^ RIHt ^ RIHtHt ^ RIH	t	H
t
 ^ RIHt  ! R R]P                  R	7      t ! R
 R]]P                  R	7      t ! R R]]P                  R	7      t ! R R]]P                  R	7      t ! R R]]P                  R	7      tR R ltR R ltR R ltR R lt ! R R]4      t ! R R]4      t ! R R]4      t ! R  R!]4      t ! R" R#]4      t ! R$ R%]4      t ! R& R']4      t ! R( R)]]4      tR# )*    )annotationsN)utils)UnsupportedAlgorithm_Reasons)BlockCipherAlgorithmCipherAlgorithm)
algorithmsc                  t    ] tR t^t]]P                  R R l4       4       t]P                  R R l4       tRt	R# )Modec                   V ^8  d   QhRR/# )   returnstr )formats   "s/home/wkmabra/.openclaw/workspace/venv/lib/python3.14/site-packages/cryptography/hazmat/primitives/ciphers/modes.py__annotate__Mode.__annotate__   s      c     c                    R# )z0
A string naming this mode (e.g. "ECB", "CBC").
Nr   selfs   &r   name	Mode.name       r   c                    V ^8  d   QhRRRR/# r   	algorithmr   r   Noner   )r   s   "r   r   r      s       D r   c                    R# )zY
Checks that all the necessary invariants of this (mode, algorithm)
combination are met.
Nr   r   r   s   &&r   validate_for_algorithmMode.validate_for_algorithm   r   r   r   N)
__name__
__module____qualname____firstlineno__propertyabcabstractmethodr   r"   __static_attributes__r   r   r   r   r      s<      
 	 r   r   )	metaclassc                  J    ] tR t^"t]]P                  R R l4       4       tRtR# )ModeWithInitializationVectorc                   V ^8  d   QhRR/# r   r   utils.Bufferr   )r   s   "r   r   )ModeWithInitializationVector.__annotate__%   s      | r   c                    R# )z@
The value of the initialization vector for this mode as bytes.
Nr   r   s   &r   initialization_vector2ModeWithInitializationVector.initialization_vector#   r   r   r   N)	r$   r%   r&   r'   r(   r)   r*   r4   r+   r   r   r   r.   r.   "   "      r   r.   c                  J    ] tR t^+t]]P                  R R l4       4       tRtR# )ModeWithTweakc                   V ^8  d   QhRR/# r0   r   )r   s   "r   r   ModeWithTweak.__annotate__.         | r   c                    R# )z0
The value of the tweak for this mode as bytes.
Nr   r   s   &r   tweakModeWithTweak.tweak,   r   r   r   N)	r$   r%   r&   r'   r(   r)   r*   r=   r+   r   r   r   r8   r8   +   r6   r   r8   c                  J    ] tR t^4t]]P                  R R l4       4       tRtR# )ModeWithNoncec                   V ^8  d   QhRR/# r0   r   )r   s   "r   r   ModeWithNonce.__annotate__7   r;   r   c                    R# )z0
The value of the nonce for this mode as bytes.
Nr   r   s   &r   nonceModeWithNonce.nonce5   r   r   r   N)	r$   r%   r&   r'   r(   r)   r*   rD   r+   r   r   r   r@   r@   4   r6   r   r@   c                  J    ] tR t^=t]]P                  R R l4       4       tRtR# )ModeWithAuthenticationTagc                   V ^8  d   QhRR/# r   r   bytes | Noner   )r   s   "r   r   &ModeWithAuthenticationTag.__annotate__@   s      \ r   c                    R# )z@
The value of the tag supplied to the constructor of this mode.
Nr   r   s   &r   tagModeWithAuthenticationTag.tag>   r   r   r   N)	r$   r%   r&   r'   r(   r)   r*   rM   r+   r   r   r   rG   rG   =   r6   r   rG   c               $    V ^8  d   QhRRRRRR/# )r   r   r   r   r   r   r   r   )r   s   "r   r   r   F   s!     
 
 
 
T 
r   c                d    VP                   R 8  d   VP                  R8X  d   \        R4      hR# R# )   AESz=Only 128, 192, and 256 bit keys are allowed for this AES modeN)key_sizer   
ValueErrorr!   s   &&r   _check_aes_key_lengthrU   F   s3    CINNe$;K
 	
 %<r   c               $    V ^8  d   QhRRRRRR/# )r   r   r.   r   r   r   r   r   )r   s   "r   r   r   M   s)     I I
&I3GI	Ir   c                    \        V P                  4      pV^,          VP                  8w  d   \        RV RV P                   R24      hR# )   zInvalid IV size () for .N)lenr4   
block_sizerT   r   )r   r   iv_lens   && r   _check_iv_lengthr^   M   sJ     ++,FzY))),VHF499+QGHH *r   c               (    V ^8  d   QhRRRRRRRR/# )	r   rD   r1   r   r   r   r   r   r   r   )r   s   "r   r   r   U   s2     	K 	K	K"	K/>	K		Kr   c                    \        V\        4      '       g   \        V R 2\        P                  4      h\        V 4      ^,          VP                  8w  d   \        R\        V 4       RV R24      hR# )" requires a block cipher algorithmzInvalid nonce size (rY   rZ   N)
isinstancer   r   r   UNSUPPORTED_CIPHERr[   r\   rT   )rD   r   r   s   &&&r   _check_nonce_lengthrd   U   so     i!566"f67''
 	
 5zA~---/E
|6$qIJJ .r   c               $    V ^8  d   QhRRRRRR/# )r   r   r.   r   r   r   r   r   )r   s   "r   r   r   a   s$     	& 	&
&	&3B	&		&r   c                    \        V\        4      '       g   \        V  R 2\        P                  4      h\        W4       \        W4       R# )ra   N)rb   r   r   r   rc   rU   r^   r!   s   &&r   _check_iv_and_key_lengthrg   a   sE     i!566"f67''
 	
 $*T%r   c                  @    ] tR t^mtR tR R lt]R R l4       t]t	Rt
R# )CBCc                   V ^8  d   QhRR/# r   r4   r1   r   )r   s   "r   r   CBC.__annotate__p        < <l <r   c                	@    \         P                  ! R V4       Wn        R# r4   Nr   _check_byteslike_initialization_vectorr   r4   s   &&r   __init__CBC.__init__p       68MN&;#r   c                   V ^8  d   QhRR/# r0   r   )r   s   "r   r   rl   u        + +| +r   c                	    V P                   # Nrr   r   s   &r   r4   CBC.initialization_vectort       ***r   r{   Nr$   r%   r&   r'   r   rt   r(   r4   rg   r"   r+   r   r   r   ri   ri   m   (    D< + + 6r   ri   c                  H    ] tR t^{tR tR R lt]R R l4       tR R ltRt	R# )	XTSc                   V ^8  d   QhRR/# )r   r=   r1   r   )r   s   "r   r   XTS.__annotate__~   s      l r   c                	v    \         P                  ! R V4       \        V4      ^8w  d   \        R4      hWn        R# )r=   z!tweak must be 128-bits (16 bytes)N)r   rq   r[   rT   _tweak)r   r=   s   &&r   rt   XTS.__init__~   s/    w.u:@AAr   c                   V ^8  d   QhRR/# r0   r   )r   s   "r   r   r            | r   c                	    V P                   # rz   r   r   s   &r   r=   	XTS.tweak       {{r   c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r      s       D r   c                	    \        V\        P                  \        P                  34      '       d   \	        R 4      hVP
                  R9  d   \        R4      hR# )z\The AES128 and AES256 classes do not support XTS, please use the standard AES class instead.z\The XTS specification requires a 256-bit key for AES-128-XTS and 512-bit key for AES-256-XTSN)rQ   i   )rb   r	   AES128AES256	TypeErrorrS   rT   r!   s   &&r   r"   XTS.validate_for_algorithm   sY    i*"3"3Z5F5F!GHH2 
 Z/3  0r   r   N)
r$   r%   r&   r'   r   rt   r(   r=   r"   r+   r   r   r   r   r   {   s*    D   r   r   c                      ] tR t^tR t]tRtR# )ECBr   N)r$   r%   r&   r'   r   rU   r"   r+   r   r   r   r   r      s    D2r   r   c                  @    ] tR t^tR tR R lt]R R l4       t]t	Rt
R# )OFBc                   V ^8  d   QhRR/# rk   r   )r   s   "r   r   OFB.__annotate__   rm   r   c                	@    \         P                  ! R V4       Wn        R# ro   rp   rs   s   &&r   rt   OFB.__init__   rv   r   c                   V ^8  d   QhRR/# r0   r   )r   s   "r   r   r      rx   r   c                	    V P                   # rz   r{   r   s   &r   r4   OFB.initialization_vector   r}   r   r{   Nr~   r   r   r   r   r      r   r   r   c                  @    ] tR t^tR tR R lt]R R l4       t]t	Rt
R# )CFBc                   V ^8  d   QhRR/# rk   r   )r   s   "r   r   CFB.__annotate__   rm   r   c                	@    \         P                  ! R V4       Wn        R# ro   rp   rs   s   &&r   rt   CFB.__init__   rv   r   c                   V ^8  d   QhRR/# r0   r   )r   s   "r   r   r      rx   r   c                	    V P                   # rz   r{   r   s   &r   r4   CFB.initialization_vector   r}   r   r{   Nr~   r   r   r   r   r      r   r   r   c                  @    ] tR t^tR tR R lt]R R l4       t]t	Rt
R# )CFB8c                   V ^8  d   QhRR/# rk   r   )r   s   "r   r   CFB8.__annotate__   rm   r   c                	@    \         P                  ! R V4       Wn        R# ro   rp   rs   s   &&r   rt   CFB8.__init__   rv   r   c                   V ^8  d   QhRR/# r0   r   )r   s   "r   r   r      rx   r   c                	    V P                   # rz   r{   r   s   &r   r4   CFB8.initialization_vector   r}   r   r{   Nr~   r   r   r   r   r      s(    D< + + 6r   r   c                  H    ] tR t^tR tR R lt]R R l4       tR R ltRt	R# )	CTRc                   V ^8  d   QhRR/# )r   rD   r1   r   )r   s   "r   r   CTR.__annotate__   s      l r   c                	@    \         P                  ! R V4       Wn        R# )rD   N)r   rq   _nonce)r   rD   s   &&r   rt   CTR.__init__   s    w.r   c                   V ^8  d   QhRR/# r0   r   )r   s   "r   r   r      r   r   c                	    V P                   # rz   r   r   s   &r   rD   	CTR.nonce   r   r   c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r      s     > > >D >r   c                	^    \        W4       \        V P                  V P                  V4       R # rz   )rU   rd   rD   r   r!   s   &&r   r"   CTR.validate_for_algorithm   s    d.DJJ		9=r   r   N)
r$   r%   r&   r'   r   rt   r(   rD   r"   r+   r   r   r   r   r      s*    D  > >r   r   c                  j    ] tR t^tR tRtRtRR R llt]R R l4       t	]R R l4       t
R R	 ltR
tR# )GCMNc               $    V ^8  d   QhRRRRRR/# )r   r4   r1   rM   rJ   min_tag_lengthintr   )r   s   "r   r   GCM.__annotate__   s(     . .+. . 	.r   c                	F   \         P                  ! R V4       \        V4      ^8  g   \        V4      ^8  d   \        R4      hWn        VeI   \         P
                  ! RV4       V^8  d   \        R4      h\        V4      V8  d   \        RV R24      hW n        W0n        R# )r4   zIinitialization_vector must be between 8 and 128 bytes (64 and 1024 bits).NrM   zmin_tag_length must be >= 4zAuthentication tag must be z bytes or longer.)r   rq   r[   rT   rr   _check_bytes_tag_min_tag_length)r   r4   rM   r   s   &&&&r   rt   GCM.__init__   s     	68MN$%)S1F-G#-M"  '<#?uc*! !>??3x.( 1.1A B   	-r   c                   V ^8  d   QhRR/# rI   r   )r   s   "r   r   r      s      \ r   c                	    V P                   # rz   )r   r   s   &r   rM   GCM.tag   s    yyr   c                   V ^8  d   QhRR/# r0   r   )r   s   "r   r   r      rx   r   c                	    V P                   # rz   r{   r   s   &r   r4   GCM.initialization_vector   r}   r   c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r      s       D r   c                	   \        W4       \        V\        4      '       g   \        R \        P
                  4      hVP                  ^,          pV P                  e,   \        V P                  4      V8  d   \        RV R24      hR# R# )z%GCM requires a block cipher algorithmNz'Authentication tag cannot be more than z bytes.)
rU   rb   r   r   r   rc   r\   r   r[   rT   )r   r   block_size_bytess   && r   r"   GCM.validate_for_algorithm   s    d.)%9::&7++  %//1499 S^6F%F9:J9K L   &G r   )rr   r   r   l   ? l            )N   )r$   r%   r&   r'   r   _MAX_ENCRYPTED_BYTES_MAX_AAD_BYTESrt   r(   rM   r4   r"   r+   r   r   r   r   r      sI    D-!N.6   + + r   r   )
__future__r   r)   cryptographyr   cryptography.exceptionsr   r   /cryptography.hazmat.primitives._cipheralgorithmr   r   &cryptography.hazmat.primitives.ciphersr	   ABCMetar   r.   r8   r@   rG   rU   r^   rd   rg   ri   r   r   r   r   r   r   r   r   r   r   <module>r      s   
 # 
  B >S[[  43;; DCKK DCKK  
I	K	&6
& 6- :3$ 36
& 66
& 66' 6>- > 4
&(A 4r   