Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire committed Nov 18, 2024
1 parent d92b25e commit 868b241
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 868b241

Please sign in to comment.