diff --git a/src/key.rs b/src/key.rs index f3ec86c..b7747d6 100644 --- a/src/key.rs +++ b/src/key.rs @@ -174,9 +174,6 @@ impl RsaPublicKey { /// Maximum size of the modulus `n` in bits. pub const MAX_SIZE: usize = 4096; - /// Minimum size of the modulus `n` in bits. - pub const MIN_SIZE: usize = 16; - /// Create a new public key from its components. /// /// This function accepts public keys with a modulus size up to 4096-bits, @@ -507,11 +504,7 @@ pub fn check_public(public_key: &impl PublicKeyParts) -> Result<()> { /// Check that the public key is well formed and has an exponent within acceptable bounds. #[inline] fn check_public_with_max_size(public_key: &impl PublicKeyParts, max_size: usize) -> Result<()> { - let public_bits = public_key.n().bits(); - if public_bits < RsaPublicKey::MIN_SIZE { - return Err(Error::InvalidModulus); - } - if public_bits > max_size { + if public_key.n().bits() > max_size { return Err(Error::ModulusTooLarge); }