Skip to content

Commit

Permalink
rsa: Make modulus length limit independent of internal limits.
Browse files Browse the repository at this point in the history
Even if we make arithmetic's limits larger, we don't want to change
rsa's limits.
  • Loading branch information
briansmith committed Jan 19, 2025
1 parent 4409154 commit 625a97a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rsa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ use crate::{
arithmetic::bigint,
bits, error,
io::{self, der},
limb,
};

pub(crate) mod padding;

// Maximum RSA modulus size supported for signature verification (in bytes).
const PUBLIC_KEY_PUBLIC_MODULUS_MAX_LEN: usize = bigint::MODULUS_MAX_LIMBS * limb::LIMB_BYTES;
const PUBLIC_KEY_PUBLIC_MODULUS_MAX_LEN: usize =
bits::BitLength::from_bits(8192).as_usize_bytes_rounded_up();

// Keep in sync with the documentation comment for `KeyPair`.
const PRIVATE_KEY_PUBLIC_MODULUS_MAX_BITS: bits::BitLength = bits::BitLength::from_bits(4096);
Expand Down

0 comments on commit 625a97a

Please sign in to comment.