Skip to content

Commit c13eefc

Browse files
committed
Satisfy clippy
1 parent 5e6bd86 commit c13eefc

File tree

4 files changed

+13
-20
lines changed

4 files changed

+13
-20
lines changed

aws-lc-rs/src/aead/tls.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl TlsRecordSealingKey {
4646
///
4747
/// # Errors
4848
/// * `Unspecified`: Returned if the length of `key_bytes` does not match the chosen algorithm,
49-
/// or if an unsupported algorithm is provided.
49+
/// or if an unsupported algorithm is provided.
5050
pub fn new(
5151
algorithm: &'static Algorithm,
5252
protocol: TlsProtocolId,
@@ -191,7 +191,7 @@ impl TlsRecordOpeningKey {
191191
///
192192
/// # Errors
193193
/// * `Unspecified`: Returned if the length of `key_bytes` does not match the chosen algorithm,
194-
/// or if an unsupported algorithm is provided.
194+
/// or if an unsupported algorithm is provided.
195195
pub fn new(
196196
algorithm: &'static Algorithm,
197197
protocol: TlsProtocolId,

aws-lc-rs/src/cipher.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,7 @@ impl UnboundCipherKey {
410410
///
411411
/// # Errors
412412
///
413-
/// * [`Unspecified`] if `key_bytes.len()` does not match the
414-
/// length required by `algorithm`.
413+
/// * [`Unspecified`] if `key_bytes.len()` does not match the length required by `algorithm`.
415414
pub fn new(algorithm: &'static Algorithm, key_bytes: &[u8]) -> Result<Self, Unspecified> {
416415
let key_bytes = Buffer::new(key_bytes.to_vec());
417416
Ok(UnboundCipherKey {
@@ -488,7 +487,7 @@ impl EncryptingKey {
488487
///
489488
/// # Errors
490489
/// * [`Unspecified`]: Returned if cipher mode requires input to be a multiple of the block length,
491-
/// and `in_out.len()` is not. Otherwise, returned if encryption fails.
490+
/// and `in_out.len()` is not. Otherwise, returned if encryption fails.
492491
pub fn encrypt(&self, in_out: &mut [u8]) -> Result<DecryptionContext, Unspecified> {
493492
let context = self.algorithm.new_encryption_context(self.mode)?;
494493
self.less_safe_encrypt(in_out, context)
@@ -501,7 +500,7 @@ impl EncryptingKey {
501500
///
502501
/// # Errors
503502
/// * [`Unspecified`]: Returned if cipher mode requires input to be a multiple of the block length,
504-
/// and `in_out.len()` is not. Otherwise returned if encryption fails.
503+
/// and `in_out.len()` is not. Otherwise returned if encryption fails.
505504
pub fn less_safe_encrypt(
506505
&self,
507506
in_out: &mut [u8],
@@ -575,7 +574,7 @@ impl DecryptingKey {
575574
///
576575
/// # Errors
577576
/// * [`Unspecified`]: Returned if cipher mode requires input to be a multiple of the block length,
578-
/// and `in_out.len()` is not. Also returned if decryption fails.
577+
/// and `in_out.len()` is not. Also returned if decryption fails.
579578
pub fn decrypt<'in_out>(
580579
&self,
581580
in_out: &'in_out mut [u8],

aws-lc-rs/src/cipher/streaming.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -390,9 +390,7 @@ mod tests {
390390
let mut buffer_update = encrypt_key
391391
.update(&plaintext, &mut ciphertext_buff)
392392
.unwrap();
393-
let (decrypt_ctx, _) = encrypt_key
394-
.finish(&mut buffer_update.remainder_mut())
395-
.unwrap();
393+
let (decrypt_ctx, _) = encrypt_key.finish(buffer_update.remainder_mut()).unwrap();
396394

397395
let unbound_key2 = UnboundCipherKey::new(cipher_alg, &key).unwrap();
398396
let mut decrypt_key =
@@ -402,9 +400,7 @@ mod tests {
402400
let mut buffer_update = decrypt_key
403401
.update(&ciphertext_buff, &mut plaintext_buff)
404402
.unwrap();
405-
let _ = decrypt_key
406-
.finish(&mut buffer_update.remainder_mut())
407-
.unwrap();
403+
let _ = decrypt_key.finish(buffer_update.remainder_mut()).unwrap();
408404

409405
assert_eq!(&plaintext_buff, &plaintext);
410406
}
@@ -444,9 +440,7 @@ mod tests {
444440
let mut buffer_update = decrypt_key
445441
.update(&ciphertext_buff[0..ciphertext_len], &mut plaintext_buff)
446442
.unwrap();
447-
let _ = decrypt_key
448-
.finish(&mut buffer_update.remainder_mut())
449-
.unwrap();
443+
let _ = decrypt_key.finish(buffer_update.remainder_mut()).unwrap();
450444

451445
assert_eq!(&plaintext_buff[0..plaintext_len], &plaintext);
452446
}

aws-lc-rs/src/key_wrap.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ impl KeyWrap for KeyEncryptionKey<AesBlockCipher> {
205205
///
206206
/// # Errors
207207
/// * [`Unspecified`]: An error occurred either due to `output` being insufficiently sized, `input` exceeding
208-
/// the allowed input size, or for other unspecified reasons.
208+
/// the allowed input size, or for other unspecified reasons.
209209
fn wrap<'output>(
210210
self,
211211
plaintext: &[u8],
@@ -259,7 +259,7 @@ impl KeyWrap for KeyEncryptionKey<AesBlockCipher> {
259259
///
260260
/// # Errors
261261
/// * [`Unspecified`]: An error occurred either due to `output` being insufficiently sized, `input` exceeding
262-
/// the allowed input size, or for other unspecified reasons.
262+
/// the allowed input size, or for other unspecified reasons.
263263
fn unwrap<'output>(
264264
self,
265265
ciphertext: &[u8],
@@ -318,7 +318,7 @@ impl KeyWrapPadded for KeyEncryptionKey<AesBlockCipher> {
318318
///
319319
/// # Errors
320320
/// * [`Unspecified`]: An error occurred either due to `output` being insufficiently sized, `input` exceeding
321-
/// the allowed input size, or for other unspecified reasons.
321+
/// the allowed input size, or for other unspecified reasons.
322322
fn wrap_with_padding<'output>(
323323
self,
324324
plaintext: &[u8],
@@ -364,7 +364,7 @@ impl KeyWrapPadded for KeyEncryptionKey<AesBlockCipher> {
364364
///
365365
/// # Errors
366366
/// * [`Unspecified`]: An error occurred either due to `output` being insufficiently sized, `input` exceeding
367-
/// the allowed input size, or for other unspecified reasons.
367+
/// the allowed input size, or for other unspecified reasons.
368368
fn unwrap_with_padding<'output>(
369369
self,
370370
ciphertext: &[u8],

0 commit comments

Comments
 (0)