Skip to content

Commit

Permalink
chacha: Ensure we're always guarding against empty inputs.
Browse files Browse the repository at this point in the history
In the future we'll make this a const assertion.
  • Loading branch information
briansmith committed Jan 23, 2025
1 parent 90f2c88 commit 2607f4b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/aead/chacha/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ pub(super) unsafe fn chacha20_ctr32_ffi<
cpu: Cpu,
f: unsafe extern "C" fn(*mut u8, *const u8, crate::c::size_t, &[u32; 8], &Counter),
) {
assert!(MIN_LEN > 0);
let in_out: Overlapping<'_, u8> = in_out.into();
let (input, output, len) = in_out.into_input_output_len();
assert!(len >= MIN_LEN);
Expand Down

0 comments on commit 2607f4b

Please sign in to comment.