+
    io   c                  s   ^ RI Ht ^ RIt^ RIt^ RIt^ RIHt ^ RIHt	 ^ RI
HtHt ^ RIHt ^ RIHt  ! R R	]P$                  R
7      t]t]P+                  ]	P,                  P&                  4        ! R R]P$                  R
7      t]t]P+                  ]	P,                  P.                  4       ]	P,                  P2                  t]	P,                  P4                  tRR R lltR R ltR R ltR R ltR R ltR R lt R R lt!Rt"R R lt#R# )i    )annotationsN)gcd)openssl)_serializationhashes)AsymmetricPadding)utilsc                  sF   ] tR t^t]P
                  R R l4       t]]P
                  R R l4       4       t]P
                  R R l4       t	]P
                  R R l4       t
]P
                  R	 R
 l4       t]P
                  R R l4       t]P
                  R R l4       tRtR# )RSAPrivateKeyc               $    V ^8  d   QhRRRRRR/# )   
ciphertextbytespaddingr   return format   "T/usr/lib64/python3.14/site-packages/cryptography/hazmat/primitives/asymmetric/rsa.py__annotate__RSAPrivateKey.__annotate__   s"      % 2C      c                    R# )z#
Decrypts the provided ciphertext.
Nr   )selfr
   r      &&&r   decryptZRSAPrivateKey.decrypt       r   c                   V ^8  d   QhRR/# r	   r   intr   r   r   r   r   r            # r   c                r   z'
The bit length of the public modulus.
Nr   r      &r   key_sizeZRSAPrivateKey.key_size   r   r   c               r   r	   r   RSAPublicKeyr   r   r   r   r   r   !   s      L r   c                r   )z4
The RSAPublicKey associated with this private key.
Nr   r    r!   r   
public_keyZRSAPrivateKey.public_key    r   r   c               (    V ^8  d   QhRRRRRRRR/# )r	   datar   r   r   	algorithm+asym_utils.Prehashed | hashes.HashAlgorithmr   r   r   r   r   r   r   '   s2       # ?	
 
r   c                r   )z
Signs the data.
Nr   )r   r'   r   r(      &&&&r   signZRSAPrivateKey.sign&   r   r   c               r   )r	   r   RSAPrivateNumbersr   r   r   r   r   r   2   s      !2 r   c                r   )z
Returns an RSAPrivateNumbers.
Nr   r    r!   r   private_numbersZRSAPrivateKey.private_numbers1   r   r   c               s(    V ^8  d   QhRRRRRRRR/# )	r	   encoding_serialization.Encodingr   z_serialization.PrivateFormatencryption_algorithmz)_serialization.KeySerializationEncryptionr   r   r   r   r   r   r   r   8   s3      ) - H	
 
r   c                r   z&
Returns the key serialized as bytes.
Nr   )r   r.   r   r0   r*   r   private_bytesZRSAPrivateKey.private_bytes7   r   r   c               r   )r	   r   r   r   r   r   r   r   r   C   s      - r   c                r   z
Returns a copy.
Nr   r    r!   r   __copy__ZRSAPrivateKey.__copy__B   r   r   r   N)__name__
__module____qualname____firstlineno__abcabstractmethodr   propertyr"   r%   r+   r-   r2   r4   __static_attributes__r   r   r   r   r      s     
   
 	 
 	  	 
 	  	 r   r   )Z	metaclassc                  sp   ] tR t^Mt]P
                  R R l4       t]]P
                  R R l4       4       t]P
                  R R l4       t	]P
                  R R l4       t
]P
                  R	 R
 l4       t]P
                  R R l4       t]P
                  R R l4       t]P
                  R R l4       tRtR# )r$   c               r   )r	   	plaintextr   r   r   r   r   r   r   r   r   RSAPublicKey.__annotate__O   s"       1B u r   c                r   )z
Encrypts the given plaintext.
Nr   )r   r=   r   r   r   encryptZRSAPublicKey.encryptN   r   r   c               r   r   r   r   r   r   r   r>   V   r   r   c                r   r   r   r    r!   r   r"   ZRSAPublicKey.key_sizeT   r   r   c               r   )r	   r   RSAPublicNumbersr   r   r   r   r   r>   \   s       0 r   c                r   )z
Returns an RSAPublicNumbers
Nr   r    r!   r   public_numbersZRSAPublicKey.public_numbers[   r   r   c               s$    V ^8  d   QhRRRRRR/# )r	   r.   r/   r   z_serialization.PublicFormatr   r   r   r   r   r   r   r>   b   s(      ) , 
	r   c                r   r1   r   )r   r.   r   r   r   public_bytesZRSAPublicKey.public_bytesa   r   r   c          
     s,    V ^8  d   QhRRRRRRRRRR	/# )
r	   	signaturer   r'   r   r   r(   r)   r   Noner   r   r   r   r   r>   l   s<     	 		 	 #		
 ?	 
	r   c                r   )z%
Verifies the signature of the data.
Nr   )r   rC   r'   r   r(   s   &&&&&r   verifyZRSAPublicKey.verifyk   r   r   c               r&   )r	   rC   r   r   r   r(   zhashes.HashAlgorithm | Noner   r   r   r   r   r   r>   x   s2       # /	
 
r   c                r   )z0
Recovers the original data from the signature.
Nr   )r   rC   r   r(   r*   r   recover_data_from_signatureZ(RSAPublicKey.recover_data_from_signaturew   r   r   c               s     V ^8  d   QhRRRR/# )r	   otherZobjectr   Zboolr   r   r   r   r   r>      s      F t r   c                r   )z
Checks equality.
Nr   )r   rG      &&r   __eq__ZRSAPublicKey.__eq__   r   r   c               r   r#   r   r   r   r   r   r>      s      , r   c                r   r3   r   r    r!   r   r4   ZRSAPublicKey.__copy__   r   r   r   N)r5   r6   r7   r8   r9   r:   r?   r;   r"   rA   rB   rE   rF   rI   r4   r<   r   r   r   r$   r$   M   s     
   
 	 
 	  		 	 	  	 
 	 r   r$   c               s(    V ^8  d   QhRRRRRRRR/# )r	   public_exponentr   r"   backendz
typing.Anyr   r   r   r   r   r   r   r      s6     L LLL L 	Lr   c                sV    \        W4       \        P                  P                  W4      # N)_verify_rsa_parametersrust_opensslrsagenerate_private_key)rJ   r"   rK   r   r   rP   rP      s#    
 ?500KKr   c               s$    V ^8  d   QhRRRRRR/# )r	   rJ   r   r"   r   rD   r   r   r   r   r   r      s&     A AC A3 A4 Ar   c                sN    V R9  d   \        R4      hVR8  d   \        R4      hR# )   zopublic_exponent must be either 3 (for legacy compatibility) or 65537. Almost everyone should choose 65537 here!i   z$key_size must be at least 1024-bits.N)rQ   i  
ValueError)rJ   r"   rH   r   rM   rM      s6    j(?
 	

 $?@@ r   c               $    V ^8  d   QhRRRRRR/# )r	   er   mr   r   r   r   r   r   r      s!     
 
s 
s 
s 
r   c                st    ^^ r2YrTV^ 8  d&   \        WE4      w  rgW&V,          ,
          pWWW83w  rEr#K,  W!,          # )zG
Modular Multiplicative Inverse. Returns x such that: (x*e) mod m == 1
)divmod)	rU   rV   Zx1Zx2aZbqrZxns	   &&       r   _modinvr[      sC     q
a%a|b&[R|b"6Mr   c               rT   )r	   pr   rY   r   r   r   r   r   r   r      s!      C C C r   c                sJ    V ^8:  g   V^8:  d   \        R4      h\        W4      # )z>
Compute the CRT (q ** -1) % p value from RSA primes p and q.
Values can't be <= 1)rS   r[   )r\   rY   rH   r   rsa_crt_iqmpr^      s'     	Ava/001=r   c               rT   )r	   private_exponentr   r\   r   r   r   r   r   r   r      !     & &3 &3 &3 &r   c                R    V ^8:  g   V^8:  d   \        R4      hW^,
          ,          # )z[
Compute the CRT private_exponent % (p - 1) value from the RSA
private_exponent (d) and p.
r]   rR   )r_   r\   rH   r   rsa_crt_dmp1rb      +    
 1Q/001u%%r   c               rT   )r	   r_   r   rY   r   r   r   r   r   r   r      r`   r   c                ra   )z[
Compute the CRT private_exponent % (q - 1) value from the RSA
private_exponent (d) and q.
r]   rR   )r_   rY   rH   r   rsa_crt_dmq1rd      rc   r   c               s(    V ^8  d   QhRRRRRRRR/# )r	   rU   r   r\   rY   r   r   r   r   r   r   r      s(        C  C  C  C  r   c                s    V ^8:  g   V^8:  g   V^8:  d   \        R4      hV^,
          V^,
          ,          \        V^,
          V^,
          4      ,          p\        W4      # )z
Compute the RSA private_exponent (d) given the public exponent (e)
and the RSA primes p and q.

This uses the Carmichael totient function to generate the
smallest possible working value of the private exponent.
r]   )rS   r   r[   )rU   r\   rY   Zlambda_ns   &&& r   rsa_recover_private_exponentre      sT    " 	Ava16/00A!a% CAq1u$55H1r   i  c               s(    V ^8  d   QhRRRRRRRR/# )r	   nr   rU   dr   ztuple[int, int]r   r   r   r   r   r      s(     - - - - - -r   c                s   V^8:  g   V^8:  d   \        R4      h^\        ^W,          V 4      8w  d   \        R4      hW!,          ^,
          pTpV^,          ^ 8X  d   V^,          pK  Rp^ pV'       g   V\        8  d   \        P                  ! ^V ^,
          4      pV^,          pTpW8  g   KD  \        WxV 4      p	V	^8w  d7   W^,
          8w  d*   \        V	^V 4      ^8X  d   \        V	^,           V 4      p
RpK  V^,          pK\  V'       g   \        R4      h\        V X
4      w  rV^ 8X  g   Q h\        W3RR7      w  rW3# )z
Compute factors p and q from the private exponent d. We assume that n has
no more than two factors. This function is adapted from code in PyCrypto.
zd, e can't be <= 1zn, d, e don't matchFTz2Unable to compute factors p and q from exponent d.)Zreverse)rS   Zpow_MAX_RECOVERY_ATTEMPTSrandomZrandintr   rW   Zsorted)rf   rU   rg   ZktotZtZspottedZtriesrX   ZkZcandr\   rY   rZ   s   &&&          r   rsa_recover_prime_factorsrj      s*    	Ava-..	SQUA.//519D 	A
a%1*F GE%"88NN1a!e$
hqQ<DqyT!e_T1aA1E q!$FAMNN!Q<DA6M61&$'DA6Mr   rL   )$Z
__future__r    r9   ri   ZtypingZmathr   Z"cryptography.hazmat.bindings._rustr   rN   Zcryptography.hazmat.primitivesr   r   Z*cryptography.hazmat.primitives._asymmetricr   Z)cryptography.hazmat.primitives.asymmetricr   Z
asym_utilsZABCMetar   ZRSAPrivateKeyWithSerializationZregisterrO   r$   ZRSAPublicKeyWithSerializationr,   r@   rP   rM   r[   r^   rb   rd   re   rh   rj   r   r   r   <module>rk      s   
 # 
    F A H I4ckk 4n "/    |''55 6?S[[ ?D !-    l&&33 4 $$66 ##44 LA
&& 2  -r   