Skip to content

Commit b5ff9ac

Browse files
committed
Satisfy clippy
1 parent 05e253e commit b5ff9ac

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
@@ -382,9 +382,7 @@ mod tests {
382382
let mut buffer_update = encrypt_key
383383
.update(&plaintext, &mut ciphertext_buff)
384384
.unwrap();
385-
let (decrypt_ctx, _) = encrypt_key
386-
.finish(&mut buffer_update.remainder_mut())
387-
.unwrap();
385+
let (decrypt_ctx, _) = encrypt_key.finish(buffer_update.remainder_mut()).unwrap();
388386

389387
let unbound_key2 = UnboundCipherKey::new(cipher_alg, &key).unwrap();
390388
let mut decrypt_key =
@@ -394,9 +392,7 @@ mod tests {
394392
let mut buffer_update = decrypt_key
395393
.update(&ciphertext_buff, &mut plaintext_buff)
396394
.unwrap();
397-
let _ = decrypt_key
398-
.finish(&mut buffer_update.remainder_mut())
399-
.unwrap();
395+
let _ = decrypt_key.finish(buffer_update.remainder_mut()).unwrap();
400396

401397
assert_eq!(&plaintext_buff, &plaintext);
402398
}
@@ -436,9 +432,7 @@ mod tests {
436432
let mut buffer_update = decrypt_key
437433
.update(&ciphertext_buff[0..ciphertext_len], &mut plaintext_buff)
438434
.unwrap();
439-
let _ = decrypt_key
440-
.finish(&mut buffer_update.remainder_mut())
441-
.unwrap();
435+
let _ = decrypt_key.finish(buffer_update.remainder_mut()).unwrap();
442436

443437
assert_eq!(&plaintext_buff[0..plaintext_len], &plaintext);
444438
}

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)