diff --git a/src/aead/aes_gcm.rs b/src/aead/aes_gcm.rs index 3ec133b15..fabaef95f 100644 --- a/src/aead/aes_gcm.rs +++ b/src/aead/aes_gcm.rs @@ -422,12 +422,14 @@ pub(super) fn open( fn open_strided( Combo { aes_key, gcm_key }: &Combo, aad: Aad<&[u8]>, - in_out: &mut [u8], + in_out_slice: &mut [u8], src: RangeFrom, mut ctr: Counter, tag_iv: aes::Iv, ) -> Result { - let input = in_out.get(src.clone()).ok_or(error::Unspecified)?; + let in_out = + Overlapping::new(in_out_slice, src.clone()).map_err(error::erase::)?; + let input = in_out.input(); let input_len = input.len(); let mut auth = gcm::Context::new(gcm_key, aad, input_len)?; @@ -445,7 +447,7 @@ fn open_strided)?; @@ -464,7 +466,14 @@ fn open_strided(