From 868b24110bbf0a94460a750e8e39d8c8bb466108 Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Mon, 18 Nov 2024 09:49:13 +0100 Subject: [PATCH] fixup --- src/key.rs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/key.rs b/src/key.rs index f3ec86c0..b7747d6f 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); }