diff --git a/rust/ares/src/jets/lock/aes.rs b/rust/ares/src/jets/lock/aes.rs index f5ffff0..8e67abb 100644 --- a/rust/ares/src/jets/lock/aes.rs +++ b/rust/ares/src/jets/lock/aes.rs @@ -183,6 +183,8 @@ mod util { let (mut iv, iv_bytes) = IndirectAtom::new_raw_mut_bytearray::<16, NockStack>(stack); + // We match on length here and elsewhere where a similar pattern is followed + // to avoid panicking when a zero length is passed to IndirectAtom::new_raw_mut_bytes. match txt_len { 0 => { ac_aes_siv_en::(key, &mut [], siv_data, iv_bytes, &mut [0u8; 0]).unwrap();