ó
    Û°›js  ã                  óà  • S SK Jr  S SKJr  S SKJrJr  S SKJr  S SKJ	r	  S SKJ
r
  S SKJrJr  S SKJr  S S	KJr  S S
KJr  S SKJr  S SKJr  S SKJrJrJr  S SKJr   " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\\5      r\R<                  " \
\S\R@                  SS9  \R<                  " \\S\R@                  SS9  \R<                  " \	\S\R@                  SS9  g )!é    )Úannotations)Úutils)ÚUnsupportedAlgorithmÚ_Reasons)ÚCFB)ÚCFB8)ÚOFB)ÚBlockCipherAlgorithmÚCipherAlgorithm)ÚMode)ÚModeWithAuthenticationTag)ÚModeWithInitializationVector)ÚModeWithNonce)ÚModeWithTweak)Ú_check_aes_key_lengthÚ_check_iv_and_key_lengthÚ_check_nonce_length)Ú
algorithmsc                  ó:   • \ rS rSrS rSS jr\SS j5       r\r	Sr
g)ÚCBCé'   c                ó>   • [         R                  " SU5        Xl        g )NÚinitialization_vector)r   Ú_check_byteslikeÚ_initialization_vector)Úselfr   s     Úi/home/mande/repo/quber/.venv/lib/python3.13/site-packages/cryptography/hazmat/primitives/ciphers/modes.pyÚ__init__ÚCBC.__init__*   s   € Ü×ÒÐ6Ð8MÔNØ&;Õ#ó    c                ó   • U R                   $ ©N©r   ©r   s    r   r   ÚCBC.initialization_vector.   ó   € à×*Ñ*Ð*r    r#   N)r   úutils.Buffer©Úreturnr'   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Únamer   Úpropertyr   r   Úvalidate_for_algorithmÚ__static_attributes__© r    r   r   r   '   s(   † Ø€Dô<ð ó+ó ð+ð 6Ór    r   c                  ó@   • \ rS rSrS rSS jr\SS j5       rS	S jrSr	g)
ÚXTSé5   c                ór   • [         R                  " SU5        [        U5      S:w  a  [        S5      eXl        g )NÚtweaké   z!tweak must be 128-bits (16 bytes))r   r   ÚlenÚ
ValueErrorÚ_tweak)r   r7   s     r   r   ÚXTS.__init__8   s/   € Ü×Ò˜w¨Ô.äˆu‹:˜ÓÜÐ@ÓAÐAà�r    c                ó   • U R                   $ r"   ©r;   r$   s    r   r7   Ú	XTS.tweak@   ó   € à�{‰{Ðr    c                ó®   • [        U[        R                  [        R                  45      (       a  [	        S5      eUR
                  S;  a  [        S5      eg )Nz\The AES128 and AES256 classes do not support XTS, please use the standard AES class instead.)é   i   z\The XTS specification requires a 256-bit key for AES-128-XTS and 512-bit key for AES-256-XTS)Ú
isinstancer   ÚAES128ÚAES256Ú	TypeErrorÚkey_sizer:   ©r   Ú	algorithms     r   r0   ÚXTS.validate_for_algorithmD   sY   € Ü�i¤*×"3Ñ"3´Z×5FÑ5FÐ!G×HÑHÜð2óð ð
 ×Ñ ZÓ/Üð3óð ð 0r    r>   N)r7   r'   r(   ©rI   r   r)   ÚNone)
r*   r+   r,   r-   r.   r   r/   r7   r0   r1   r2   r    r   r4   r4   5   s%   † Ø€Dôð óó ð÷r    r4   c                  ó   • \ rS rSrS r\rSrg)ÚECBéR   r2   N)r*   r+   r,   r-   r.   r   r0   r1   r2   r    r   rN   rN   R   s   † Ø€Dà2Ór    rN   c                  ó@   • \ rS rSrS rSS jr\SS j5       rS	S jrSr	g)
ÚCTRéX   c                ó>   • [         R                  " SU5        Xl        g )NÚnonce)r   r   Ú_nonce)r   rT   s     r   r   ÚCTR.__init__[   s   € Ü×Ò˜w¨Ô.Ø�r    c                ó   • U R                   $ r"   ©rU   r$   s    r   rT   Ú	CTR.nonce_   r@   r    c                ó\   • [        X5        [        U R                  U R                  U5        g r"   )r   r   rT   r.   rH   s     r   r0   ÚCTR.validate_for_algorithmc   s   € Ü˜dÔ.Ü˜DŸJ™J¨¯	©	°9Õ=r    rX   N)rT   r'   r(   rK   )
r*   r+   r,   r-   r.   r   r/   rT   r0   r1   r2   r    r   rQ   rQ   X   s%   † Ø€Dôð óó ð÷>r    rQ   c                  ón   • \ rS rSrS rSrSr  S
     SS jjr\SS j5       r	\SS j5       r
SS jrS	rg)ÚGCMéh   l   àÿ? l   ÿÿÿÿ Nc                ó:  • [         R                  " SU5        [        U5      S:  d  [        U5      S:”  a  [        S5      eXl        US:  a  [        S5      eUb5  [         R
                  " SU5        [        U5      U:  a  [        SU S	35      eX l        X0l        g )
Nr   é   é€   zIinitialization_vector must be between 8 and 128 bytes (64 and 1024 bits).é   zmin_tag_length must be >= 4ÚtagzAuthentication tag must be z bytes or longer.)r   r   r9   r:   r   Ú_check_bytesÚ_tagÚ_min_tag_length)r   r   rc   Úmin_tag_lengths       r   r   ÚGCM.__init__m   s­   € ô 	×ÒÐ6Ð8MÔNÜÐ$Ó%¨Ó)¬SÐ1FÓ-GÈ#Ó-MÜð"óð ð '<Ô#Ø˜AÓÜÐ:Ó;Ð;Ø‰?Ü×Ò˜u cÔ*Ü�3‹x˜.Ó(Ü Ø1°.Ð1Að Bð óð ð Œ	Ø-Õr    c                ó   • U R                   $ r"   )re   r$   s    r   rc   ÚGCM.tagˆ   s   € à�y‰yÐr    c                ó   • U R                   $ r"   r#   r$   s    r   r   ÚGCM.initialization_vectorŒ   r&   r    c                ó  • [        X5        [        U[        5      (       d  [        S[        R
                  5      eUR                  S-  nU R                  b)  [        U R                  5      U:”  a  [        SU S35      eg g )Nz%GCM requires a block cipher algorithmr`   z'Authentication tag cannot be more than z bytes.)
r   rC   r
   r   r   ÚUNSUPPORTED_CIPHERÚ
block_sizere   r9   r:   )r   rI   Úblock_size_bytess      r   r0   ÚGCM.validate_for_algorithm�   sˆ   € Ü˜dÔ.Ü˜)Ô%9×:Ñ:Ü&Ø7Ü×+Ñ+óð ð %×/Ñ/°1Ñ4ÐØ�9‰9Ñ ¤S¨¯©£^Ð6FÓ%FÜØ9Ð:JÐ9Kð Lð óð ð &GÐ r    )r   rf   re   )Nr8   )r   r'   rc   úbytes | Nonerg   Úint)r)   rr   r(   rK   )r*   r+   r,   r-   r.   Ú_MAX_ENCRYPTED_BYTESÚ_MAX_AAD_BYTESr   r/   rc   r   r0   r1   r2   r    r   r]   r]   h   sh   † Ø€DØ-ÐØ%€Nð
 !Ø ð	.à+ð.ð ð.ð õ	.ð6 óó ðð ó+ó ð+÷r    r]   z•OFB has been moved to cryptography.hazmat.decrepit.ciphers.modes.OFB and will be removed from cryptography.hazmat.primitives.ciphers.modes in 49.0.0.r	   )r.   z•CFB has been moved to cryptography.hazmat.decrepit.ciphers.modes.CFB and will be removed from cryptography.hazmat.primitives.ciphers.modes in 49.0.0.r   z—CFB8 has been moved to cryptography.hazmat.decrepit.ciphers.modes.CFB8 and will be removed from cryptography.hazmat.primitives.ciphers.modes in 49.0.0.r   N)!Ú
__future__r   Úcryptographyr   Úcryptography.exceptionsr   r   Ú*cryptography.hazmat.decrepit.ciphers.modesr   r   r	   Ú/cryptography.hazmat.primitives._cipheralgorithmr
   r   Ú%cryptography.hazmat.primitives._modesr   r   r   r   r   r   r   r   Ú&cryptography.hazmat.primitives.ciphersr   r   r4   rN   rQ   r]   Ú
deprecatedr*   ÚDeprecatedIn47r2   r    r   Ú<module>r      s  ðõ
 #å ß BÝ AÝ CÝ A÷õõõõõ÷ñ õ
 >ô6Ð
&ô 6ôˆ-ô ô:3ˆ$ô 3ô>ˆ-ô >ô 4Ð
&Ð(Aô 4ðn × Ò ØØð>ð 
×ÑØ	ò	ð × Ò ØØð>ð 
×ÑØ	ò	ð × Ò ØØð>ð 
×ÑØ	ó	r    