Skip to content

Commit ec0757d

Browse files
authored
universal-hash: add UhfBackend::blocks_needed_to_align (#1059)
Originally suggested by @str4d here: #965 (comment) The use case is ensuring unbuffered processing of the input AEAD message body when the AAD does not line up with the number of blocks it's processing in parallel. This number of blocks can be input from the start of the message body to finish completely filling the buffer, ensuring all subsequent processing occurs at the start of the buffer.
1 parent 0b2a4a2 commit ec0757d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

universal-hash/src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ pub trait UhfBackend: ParBlocksSizeUser {
5353
self.proc_block(block);
5454
}
5555
}
56+
57+
/// Returns the number of blocks that should be passed to `Self::proc_block` before
58+
/// `Self::proc_par_blocks` can be used efficiently. This is always less than
59+
/// `Self::ParBlocksSize`.
60+
fn blocks_needed_to_align(&self) -> usize {
61+
0
62+
}
5663
}
5764

5865
/// Trait for [`UhfBackend`] users.

0 commit comments

Comments
 (0)