File: //usr/local/CyberPanel/lib64/python3.10/site-packages/rsa/__pycache__/core.cpython-310.pyc
o
��h} � @ sR d Z dededdfdd�Zdeded edefd
d�Zded
ed edefdd�ZdS )z}Core mathematical operations.
This is the actual core RSA implementation, which is only defined
mathematically on integers.
�var�name�returnNc C s t | t�rd S td|| jf ��)Nz%s should be an integer, not %s)�
isinstance�int� TypeError� __class__)r r � r �>/usr/local/CyberPanel/lib/python3.10/site-packages/rsa/core.py�
assert_int s
r
�message�ekey�nc C sR t | d� t |d� t |d� | dk rtd��| |kr#td| |f ��t| ||�S )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
r r r �encrypt_int s
r �
cyphertext�dkeyc C s. t | d� t |d� t |d� t| ||�}|S )zHDecrypts a cypher text using the decryption key 'dkey', working modulo nr r r
)r
r )r r r
r r r r �decrypt_int- s
r )�__doc__r �strr
r r r r r r �<module> s