cargo clippy

This commit is contained in:
2026-04-27 13:37:53 +02:00
parent d19b51844a
commit adfd55f99c
+4 -5
View File
@@ -48,8 +48,7 @@ impl Tea3FromC {
let b_reord_byte4 = tea3_reorder_state_byte(((self.iv >> 32) & 0xff) as u8); let b_reord_byte4 = tea3_reorder_state_byte(((self.iv >> 32) & 0xff) as u8);
// Step 3: Combine current state with state derived values and XOR in key derived SBOX output // Step 3: Combine current state with state derived values and XOR in key derived SBOX output
let b_new_byte = let b_new_byte = ((self.iv >> 56) as u8) ^ b_reord_byte4 ^ b_deriv_byte12 ^ b_sbox_out;
(((self.iv >> 56) as u8) ^ b_reord_byte4 ^ b_deriv_byte12 ^ b_sbox_out) & 0xff;
let b_mix_byte = b_deriv_byte56 as u64; let b_mix_byte = b_deriv_byte56 as u64;
// Step 4: Update 64 bits state // Step 4: Update 64 bits state
@@ -82,10 +81,10 @@ fn tea3_state_word_to_newbyte(w_st: u16, aw_lut: &[u16; 8]) -> u8 {
let mut b_st1 = (w_st >> 8) as u8; let mut b_st1 = (w_st >> 8) as u8;
let mut b_out = 0u8; let mut b_out = 0u8;
for i in 0..8 { for (i, &lut_item) in aw_lut.iter().enumerate() {
let b_dist = ((b_st0 >> 5) & 3) | ((b_st1 >> 3) & 12); let b_dist = ((b_st0 >> 5) & 3) | ((b_st1 >> 3) & 12);
if (aw_lut[i] & (1 << b_dist)) != 0 { if (lut_item & (1u16 << b_dist)) != 0 {
b_out |= 1 << i; b_out |= 1u8 << i;
} }
b_st0 = b_st0.rotate_right(1); b_st0 = b_st0.rotate_right(1);