Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ fn main() {
_ => {
panic!(
"${} has an invalid value",
&cargo::env::RING_PREGENERATE_ASM.name
cargo::env::RING_PREGENERATE_ASM.name
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion cavp/tests/shavs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ mod digest_shavs {
// length is zero.
if len_bits == 0 {
assert_eq!(msg, &[0u8]);
msg.truncate(0);
msg.clear();
}

assert_eq!(msg.len() * 8, len_bits);
Expand Down
4 changes: 2 additions & 2 deletions src/arithmetic/bigint/modulus/mont.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,11 +300,11 @@ mod base {
// Enforce the length-related invariants (only).
let Some((&[.., num_limbs], value)) = storage.split_first_chunk::<MONT_PREFIX_LEN>()
else {
return Err(LenMismatchError::new(storage.len()))?;
return Err(LenMismatchError::new(storage.len()).into());
};
let num_limbs = limb::usize_from_limb(num_limbs);
if num_limbs != value.len() {
return Err(LenMismatchError::new(storage.len()))?;
return Err(LenMismatchError::new(storage.len()).into());
}
if num_limbs < MIN_LIMBS {
return Err(LimbSliceError::too_short(num_limbs));
Expand Down
2 changes: 1 addition & 1 deletion src/testutil.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ fn parse_test_case(
Some(line) if line.starts_with('[') => {
assert!(is_first_line);
assert!(line.ends_with(']'));
current_section.truncate(0);
current_section.clear();
current_section.push_str(line);
let _ = current_section.pop();
let _ = current_section.remove(0);
Expand Down
2 changes: 1 addition & 1 deletion tests/aead_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ where
let mut in_out = vec![123u8; 4096];

for &in_prefix_len in in_prefix_lengths.iter() {
in_out.truncate(0);
in_out.clear();
in_out.resize(in_prefix_len, 123);
in_out.extend_from_slice(tc.ciphertext);
in_out.extend_from_slice(tc.tag);
Expand Down
2 changes: 1 addition & 1 deletion tests/agreement_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fn agreement_traits() {
test::compile_time_assert_sync::<agreement::EphemeralPrivateKey>();

assert_eq!(
format!("{:?}", &private_key),
format!("{:?}", private_key),
"EphemeralPrivateKey { algorithm: Algorithm { curve: P256 } }"
);

Expand Down
4 changes: 2 additions & 2 deletions tests/hmac_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ fn hmac_test_case_inner(
#[test]
fn hmac_debug() {
let key = hmac::Key::new(hmac::HMAC_SHA256, &[0; 32]);
assert_eq!("Key { algorithm: SHA256 }", format!("{:?}", &key));
assert_eq!("Key { algorithm: SHA256 }", format!("{:?}", key));

let ctx = hmac::Context::with_key(&key);
assert_eq!("Context { algorithm: SHA256 }", format!("{:?}", &ctx));
assert_eq!("Context { algorithm: SHA256 }", format!("{:?}", ctx));
}