Expand description
Shared integer arithmetic for RSAEP/RSAVP1 and RSADP/RSASP1 (RFC8017 §5).
These functions do not implement octet-string conversion or scheme encoding. In particular,
rsa_encrypt performs modular exponentiation without checking the representative’s range;
callers implementing RSAEP or RSAVP1 must establish that the input is less than n.
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. - rsa_
decrypt - ⚠️ Performs the raw RSA private-key operation without padding or a CRT fault check.
- rsa_
decrypt_ and_ check - ⚠️ Performs raw RSA decryption with no padding.
- rsa_
encrypt - ⚠️ Raw RSA public-key operation on the integer representative
m, without padding. - unblind 🔒
- Given an m and unblinding factor, unblind the m.