
    (ph}                     R    S r S\S\SS4S jrS\S\S\S\4S	 jrS
\S\S\S\4S jrg)z}Core mathematical operations.

This is the actual core RSA implementation, which is only defined
mathematically on integers.
varnamereturnNc                 f    [        U [        5      (       a  g [        U< SU R                  < 35      e)Nz should be an integer, not )
isinstanceint	TypeError	__class__)r   r   s     ;/var/www/html/venv/lib/python3.13/site-packages/rsa/core.py
assert_intr      s&    #s
s}}M
NN    messageekeync                     [        U S5        [        US5        [        US5        U S:  a  [        S5      eX:  a  [        SX4-  5      e[        XU5      $ )z@Encrypts a message using encryption key 'ekey', working modulo nr   r   r       z'Only non-negative numbers are supportedz#The message %i is too long for n=%i)r   
ValueErrorOverflowErrorpow)r   r   r   s      r
   encrypt_intr      sZ     w	"tVq#{BCC{AWLPQQwa  r   
cyphertextdkeyc                 f    [        U S5        [        US5        [        US5        [        XU5      nU$ )zHDecrypts a cypher text using the decryption key 'dkey', working modulo nr   r   r   )r   r   )r   r   r   r   s       r
   decrypt_intr   -   s3     z<(tVq#*A&GNr   )__doc__r   strr   r   r    r   r
   <module>r      sj   OC Os Ot O! !C !C !C ! C s s s r   