o j³Á`}ã@sRdZdededdfdd„Zdeded edefd d „Zd ed ed edefdd„ZdS)z}Core mathematical operations. This is the actual core RSA implementation, which is only defined mathematically on integers. ÚvarÚnameÚreturnNcCs t|tƒrdStd||jfƒ‚)Nz%s should be an integer, not %s)Ú isinstanceÚintÚ TypeErrorÚ __class__)rr©rú*/usr/lib/python3/dist-packages/rsa/core.pyÚ assert_ints r ÚmessageÚekeyÚncCsRt|dƒt|dƒt|dƒ|dkrtdƒ‚||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 rrr Ú encrypt_ints    rÚ cyphertextÚdkeycCs.t|dƒt|dƒt|dƒt|||ƒ}|S)zHDecrypts a cypher text using the decryption key 'dkey', working modulo nrrr )r r)rrr r rrr Ú decrypt_int-s    r)Ú__doc__rÚstrr rrrrrr Ús