···239239 /// `Strobe::squeeze`. It's like `squeeze` in that we assume we've been given all zeros as
240240 /// input, and like `overwrite` in that we do not mutate (or take) any input.
241241 fn zero_state(&mut self, mut bytes_to_zero: usize) {
242242+ // Put in a limit to allow for constant time checking
243243+ debug_assert!(
244244+ bytes_to_zero <= (u32::MAX as usize),
245245+ "Don't bother zeroing more than u32::MAX bytes"
246246+ );
247247+242248 // Do the zero-writing in chunks
243249 while bytes_to_zero.ct_ne(&0).into() {
244250 let min_slice = (self.rate - self.position) as u32;
···331337 // RATCHET is special cased to never call operate/operate_no_mutate directly
332338 debug_assert!(flags == ops::KEY || !bool::from(flags.contains(OpFlags::CIPHER)));
333339334334- // There are no non-mutating variants of things with flags & (C | T | I) == C | T
335335- if flags.contains(OpFlags::CIPHER).into() {
340340+ match flags {
336341 // This is equivalent to a non-mutating form of the `duplex` operation in the Python
337342 // implementation, with `cbefore = True`
338338- self.overwrite(data);
339339- } else {
343343+ ops::KEY => self.overwrite(data),
340344 // This is equivalent to the `duplex` operation in the Python implementation, with
341345 // `cbefore = cafter = False`
342342- self.absorb(data);
346346+ _ => self.absorb(data),
343347 }
344348 }
345349