
    M j                    Z   S SK Jr  S SKrS SKJr  S SKJrJr  S SKJ	r	J
r
   " S S\R                  S9r " S	 S
\\R                  S9r " S S\\R                  S9r " S S\\R                  S9r " S S\\R                  S9rSS jr      SS jr        SS jr      SS jrg)    )annotationsN)utils)UnsupportedAlgorithm_Reasons)BlockCipherAlgorithmCipherAlgorithmc                  n    \ rS rSr\\R                  SS j5       5       r\R                  SS j5       rSr	g)Mode   c                    g)z0
A string naming this mode (e.g. "ECB", "CBC").
N selfs    v/root/GenerationalWealth/GenerationalWealth/venv/lib/python3.13/site-packages/cryptography/hazmat/primitives/_modes.pyname	Mode.name           c                    g)zY
Checks that all the necessary invariants of this (mode, algorithm)
combination are met.
Nr   r   	algorithms     r   validate_for_algorithmMode.validate_for_algorithm   r   r   r   N)returnstr)r   r   r   None)
__name__
__module____qualname____firstlineno__propertyabcabstractmethodr   r   __static_attributes__r   r   r   r
   r
      s<      
 	 r   r
   )	metaclassc                  F    \ rS rSr\\R                  SS j5       5       rSrg)ModeWithInitializationVector!   c                    g)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   utils.Buffer)	r   r   r   r    r!   r"   r#   r*   r$   r   r   r   r'   r'   !   "      r   r'   c                  F    \ rS rSr\\R                  SS j5       5       rSrg)ModeWithTweak*   c                    g)z0
The value of the tweak for this mode as bytes.
Nr   r   s    r   tweakModeWithTweak.tweak+   r   r   r   Nr,   )	r   r   r   r    r!   r"   r#   r3   r$   r   r   r   r0   r0   *   r.   r   r0   c                  F    \ rS rSr\\R                  SS j5       5       rSrg)ModeWithNonce3   c                    g)z0
The value of the nonce for this mode as bytes.
Nr   r   s    r   nonceModeWithNonce.nonce4   r   r   r   Nr,   )	r   r   r   r    r!   r"   r#   r9   r$   r   r   r   r6   r6   3   r.   r   r6   c                  F    \ rS rSr\\R                  SS j5       5       rSrg)ModeWithAuthenticationTag<   c                    g)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   zbytes | None)	r   r   r   r    r!   r"   r#   r?   r$   r   r   r   r<   r<   <   r.   r   r<   c                \    UR                   S:  a  UR                  S:X  a  [        S5      eg g )N   AESz=Only 128, 192, and 256 bit keys are allowed for this AES mode)key_sizer   
ValueErrorr   s     r   _check_aes_key_lengthrF   E   s3    CINNe$;K
 	
 %<r   c                    [        U R                  5      nUS-  UR                  :w  a  [        SU SU R                   S35      eg )N   zInvalid IV size () for .)lenr*   
block_sizerE   r   )r   r   iv_lens      r   _check_iv_lengthrN   L   sJ     ++,FzY))),VHF499+QGHH *r   c                    [        U[        5      (       d  [        U S3[        R                  5      e[        U 5      S-  UR                  :w  a  [        S[        U 5       SU S35      eg )N" requires a block cipher algorithmrH   zInvalid nonce size (rI   rJ   )
isinstancer   r   r   UNSUPPORTED_CIPHERrK   rL   rE   )r9   r   r   s      r   _check_nonce_lengthrS   T   so     i!566"f67''
 	
 5zA~---/E
|6$qIJJ .r   c                    [        U[        5      (       d  [        U  S3[        R                  5      e[        X5        [        X5        g )NrP   )rQ   r   r   r   rR   rF   rN   r   s     r   _check_iv_and_key_lengthrU   `   sE     i!566"f67''
 	
 $*T%r   )r   r
   r   r   r   r   )r   r'   r   r   r   r   )r9   r-   r   r   r   r   r   r   )r   r'   r   r   r   r   )
__future__r   r"   cryptographyr   cryptography.exceptionsr   r   /cryptography.hazmat.primitives._cipheralgorithmr   r   ABCMetar
   r'   r0   r6   r<   rF   rN   rS   rU   r   r   r   <module>r[      s   
 # 
  BS[[  43;; DCKK DCKK  
I
&I3GI	I	K	K"	K/>	K		K	&
&	&3B	&		&r   