@@ -45,12 +45,12 @@ use encoding::{Label, LabelError};
4545
4646#[ cfg( feature = "aes-gcm" ) ]
4747use {
48- aead:: { AeadInPlace , array:: typenum:: U12 } ,
48+ aead:: array:: typenum:: U12 ,
4949 aes_gcm:: { Aes128Gcm , Aes256Gcm } ,
5050} ;
5151
5252#[ cfg( any( feature = "aes-gcm" , feature = "chacha20poly1305" ) ) ]
53- use aead:: KeyInit ;
53+ use aead:: { AeadInOut , KeyInit } ;
5454
5555/// AES-128 in block chaining (CBC) mode
5656const AES128_CBC : & str = "aes128-cbc" ;
@@ -236,7 +236,7 @@ impl Cipher {
236236 let nonce = iv. try_into ( ) . map_err ( |_| Error :: IvSize ) ?;
237237 let tag = tag. ok_or ( Error :: TagSize ) ?;
238238 cipher
239- . decrypt_in_place_detached ( nonce, & [ ] , buffer, & tag)
239+ . decrypt_inout_detached ( nonce, & [ ] , buffer. into ( ) , & tag)
240240 . map_err ( |_| Error :: Crypto ) ?;
241241
242242 Ok ( ( ) )
@@ -247,7 +247,7 @@ impl Cipher {
247247 let nonce = iv. try_into ( ) . map_err ( |_| Error :: IvSize ) ?;
248248 let tag = tag. ok_or ( Error :: TagSize ) ?;
249249 cipher
250- . decrypt_in_place_detached ( nonce, & [ ] , buffer, & tag)
250+ . decrypt_inout_detached ( nonce, & [ ] , buffer. into ( ) , & tag)
251251 . map_err ( |_| Error :: Crypto ) ?;
252252
253253 Ok ( ( ) )
@@ -300,7 +300,7 @@ impl Cipher {
300300 let cipher = Aes128Gcm :: new_from_slice ( key) . map_err ( |_| Error :: KeySize ) ?;
301301 let nonce = iv. try_into ( ) . map_err ( |_| Error :: IvSize ) ?;
302302 let tag = cipher
303- . encrypt_in_place_detached ( nonce, & [ ] , buffer)
303+ . encrypt_inout_detached ( nonce, & [ ] , buffer. into ( ) )
304304 . map_err ( |_| Error :: Crypto ) ?;
305305
306306 Ok ( Some ( tag) )
@@ -310,7 +310,7 @@ impl Cipher {
310310 let cipher = Aes256Gcm :: new_from_slice ( key) . map_err ( |_| Error :: KeySize ) ?;
311311 let nonce = iv. try_into ( ) . map_err ( |_| Error :: IvSize ) ?;
312312 let tag = cipher
313- . encrypt_in_place_detached ( nonce, & [ ] , buffer)
313+ . encrypt_inout_detached ( nonce, & [ ] , buffer. into ( ) )
314314 . map_err ( |_| Error :: Crypto ) ?;
315315
316316 Ok ( Some ( tag) )
0 commit comments