File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -51,10 +51,9 @@ impl StorableBuilder {
5151 pub fn deconstruct ( & self , mut storable : Storable ) -> io:: Result < ( Vec < u8 > , i64 ) > {
5252 let encryption_metadata = storable. encryption_metadata . unwrap ( ) ;
5353 let mut cipher = ChaCha20Poly1305 :: new ( & self . data_encryption_key , & encryption_metadata. nonce , & [ ] ) ;
54- let input_output = storable. data . as_mut ( ) ;
5554
56- if cipher. decrypt_inplace ( input_output , encryption_metadata. tag . borrow ( ) ) {
57- let data_blob = PlaintextBlob :: decode ( & input_output [ ..] ) . map_err ( |e| Error :: new ( ErrorKind :: InvalidData , e) ) ?;
55+ if cipher. decrypt_inplace ( & mut storable . data , encryption_metadata. tag . borrow ( ) ) {
56+ let data_blob = PlaintextBlob :: decode ( & storable . data [ ..] ) . map_err ( |e| Error :: new ( ErrorKind :: InvalidData , e) ) ?;
5857 Ok ( ( data_blob. value , data_blob. version ) )
5958 } else {
6059 Err ( Error :: new ( ErrorKind :: InvalidData , "Invalid Tag" ) )
You can’t perform that action at this time.
0 commit comments