Skip to content

Conversation

@mendess
Copy link

@mendess mendess commented Jan 26, 2026

We need to use rsa keys with large exponents, this was something that was a breaking change introduced in 2edd479#diff-0988d5d2259e1a401001675578c38d09c46290b877b66b07fb96a7e034ccdf70L274-R273

This commit mostly moves code around to avoid having duplicate code and introduces RsaPrivateKey::from_components_with_large_exponent as a way to support this use case

Comment on lines +416 to +424
/// # ⚠️ Warning: Hazmat!
///
/// This method accepts public exponents outside the standard bounds (2 ≤ e ≤ 2^33-1),
/// but still performs full cryptographic validation to ensure the key is mathematically
/// correct (i.e., verifies that de ≡ 1 mod λ(n)).
///
/// This is intended for interoperating with systems that use non-standard exponents
/// or loading legacy keys. Use [`RsaPrivateKey::from_components`] for standard key
/// construction.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be good to add some citations on why large public exponents are bad to deter use: https://www.imperialviolet.org/2012/03/17/rsados.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants