Skip to content

Commit

Permalink
Happy CI
Browse files Browse the repository at this point in the history
  • Loading branch information
skmcgrail committed Apr 8, 2024
1 parent 08e0cc5 commit 77cde52
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions aws-lc-rs/src/rsa/encryption.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ impl OaepPublicEncryptingKey {
/// # Sizing `output`
/// For `OAEP_SHA1_MGF1SHA1`, `OAEP_SHA256_MGF1SHA256`, `OAEP_SHA384_MGF1SHA384`, `OAEP_SHA512_MGF1SHA512` the
/// length of `output` must be the RSA key size in bytes. The RSA key size in bytes can be retrieved using
/// [`Self::key_size`].
/// [`Self::key_size_bytes`].
///
/// # Errors
/// * `Unspecified` for any error that occurs while encrypting `plaintext`.
Expand Down Expand Up @@ -377,7 +377,7 @@ impl OaepPrivateDecryptingKey {
///
/// # Sizing `output`
/// For `OAEP_SHA1_MGF1SHA1`, `OAEP_SHA256_MGF1SHA256`, `OAEP_SHA384_MGF1SHA384`, `OAEP_SHA512_MGF1SHA512`. The
/// length of `output` must be equal to [`Self::key_size`].
/// length of `output` must be equal to [`Self::key_size_bytes`].
///
/// # Errors
/// * `Unspecified` for any error that occurs while decrypting `ciphertext`.
Expand Down
12 changes: 12 additions & 0 deletions aws-lc-rs/src/rsa/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,18 @@ pub enum KeySize {

#[allow(clippy::len_without_is_empty)]
impl KeySize {
/// Returns the size of the key in bytes.
#[inline]
#[must_use]
pub fn len(self) -> usize {
match self {
Self::Rsa2048 => 256,
Self::Rsa3072 => 384,
Self::Rsa4096 => 512,
Self::Rsa8192 => 1024,
}
}

/// Returns the key size in bits.
#[inline]
pub(super) fn bits(self) -> i32 {
Expand Down

0 comments on commit 77cde52

Please sign in to comment.