We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d046ce2 commit 98c84bcCopy full SHA for 98c84bc
block-buffer/src/lib.rs
@@ -256,13 +256,19 @@ where
256
/// Compress remaining data after padding it with `delim`, zeros and
257
/// the `suffix` bytes. If there is not enough unused space, `compress`
258
/// will be called twice.
259
+ ///
260
+ /// # Panics
261
+ /// If suffix length is bigger than block size.
262
#[inline(always)]
263
pub fn digest_pad(
264
&mut self,
265
delim: u8,
266
suffix: &[u8],
267
mut compress: impl FnMut(&Block<BlockSize>),
268
) {
269
+ if suffix.len() > BlockSize::USIZE {
270
+ panic!("suffix is too long");
271
+ }
272
let pos = self.get_pos();
273
self.buffer[pos] = delim;
274
for b in &mut self.buffer[pos + 1..] {
0 commit comments