Expand description
Generic RSA implementation
FunctionsΒ§
- blind π
- Returns the blinded c, along with the unblinding factor.
- compute_
modulus π - Compute the modulus of a key from its primes.
- compute_
private_ πexponent_ carmicheal - Compute the private exponent from its primes (p and q) and public exponent
- compute_
private_ πexponent_ euler_ totient - Compute the private exponent from its primes (p and q) and public exponent This uses Eulerβs totient function
- pow_
mod_ πparams - Computes
base.pow_mod(exp, n)with precomputedn_params. - pow_
mod_ πparams_ vartime_ exp_ bits - Computes
base.pow_mod(exp, n)with a bounded exponent and precomputedn_params. - recover_
primes - The following (deterministic) algorithm also recovers the prime factors
pandqof a modulusn, given the public exponenteand private exponentdusing the method described in NIST 800-56B Appendix C.2. - reduce_
vartime π - rsa_
decrypt - β οΈ Performs raw RSA decryption with no padding or error checking.
- rsa_
decrypt_ and_ check - β οΈ Performs raw RSA decryption with no padding.
- rsa_
encrypt - β οΈ Raw RSA encryption of m with the public key. No padding is performed.
- unblind π
- Given an m and unblinding factor, unblind the m.