Skip to content

Commit

Permalink
belt-block: clippy 1.85 fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
baloo committed Feb 23, 2025
1 parent f639131 commit 66b672d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions belt-block/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ pub fn belt_wblock_enc(data: &mut [u8], key: &[u32; 8]) -> Result<(), InvalidLen
}

let len = data.len();
let n = (len + BLOCK_SIZE - 1) / BLOCK_SIZE;
let n = len.div_ceil(BLOCK_SIZE);
for i in 1..(2 * n + 1) {
let s = data[..len - 1]
.chunks_exact(BLOCK_SIZE)
Expand Down Expand Up @@ -141,7 +141,7 @@ pub fn belt_wblock_dec(data: &mut [u8], key: &[u32; 8]) -> Result<(), InvalidLen
}

let len = data.len();
let n = (len + BLOCK_SIZE - 1) / BLOCK_SIZE;
let n = len.div_ceil(BLOCK_SIZE);
for i in (1..(2 * n + 1)).rev() {
let tail_pos = len - BLOCK_SIZE;
let s = Block::try_from(&data[tail_pos..]).unwrap();
Expand Down

0 comments on commit 66b672d

Please sign in to comment.