File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ pub struct StorableBuilder {
16
16
const CHACHA20_CIPHER_NAME : & ' static str = "ChaCha20Poly1305" ;
17
17
18
18
impl StorableBuilder {
19
-
20
19
/// Creates a [`Storable`] that can be serialized and stored as `value` in [`PutObjectRequest`].
21
20
///
22
21
/// Uses ChaCha20 for encrypting the `input` and Poly1305 for generating mac/tag.
@@ -55,7 +54,8 @@ impl StorableBuilder {
55
54
let mut cipher = ChaCha20Poly1305 :: new ( & self . data_encryption_key , & encryption_metadata. nonce , & [ ] ) ;
56
55
57
56
if cipher. decrypt_inplace ( & mut storable. data , encryption_metadata. tag . borrow ( ) ) {
58
- let data_blob = PlaintextBlob :: decode ( & storable. data [ ..] ) . map_err ( |e| Error :: new ( ErrorKind :: InvalidData , e) ) ?;
57
+ let data_blob =
58
+ PlaintextBlob :: decode ( & storable. data [ ..] ) . map_err ( |e| Error :: new ( ErrorKind :: InvalidData , e) ) ?;
59
59
Ok ( ( data_blob. value , data_blob. version ) )
60
60
} else {
61
61
Err ( Error :: new ( ErrorKind :: InvalidData , "Invalid Tag" ) )
You can’t perform that action at this time.
0 commit comments