INNER CODE UNIT · Rust
processed_bytes
AChep/keyguard-app · thirdParty/rust/ocb3-0.1.0-keyguard/src/lib.rs:417
let processed_bytes = (buffer.len() / (WIDTH * 16)) * (WIDTH * 16);
(processed_bytes, offset_i[offset_i.len() - 1], checksum_i)
}
/// Decrypts plaintext in groups of two.
///
/// Adapted from https://www.cs.ucdavis.edu/~rogaway/ocb/news/code/ocb.c
fn wide_decrypt(&self, nonce: &Nonce<NonceSize>, buffer: &mut [u8]) -> (usize, Block, Block) {
const WIDTH: usize = 2;
let split_into_blocks = crate::util::split_into_two_blocks;
let mut i = 1;
let mut offset_i = [Block::default(); WIDTH];
offset_i[offset_i.len() - 1] = initial_offset(&self.cipher, nonce, TagSize::to_u32());
let mut checksum_i = Block::default();
for wide_blocks in buffer.chunks_exact_mut(16 * WIDTH) {