From 70143e00ba17387f83defd6c550b023681cd9a7a Mon Sep 17 00:00:00 2001 From: Theophile BREZOT Date: Mon, 12 Sep 2022 15:49:43 +0200 Subject: [PATCH] Corrections --- src/symmetric_crypto/aes_256_gcm_pure/mod.rs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/symmetric_crypto/aes_256_gcm_pure/mod.rs b/src/symmetric_crypto/aes_256_gcm_pure/mod.rs index cea8798..dbebba0 100644 --- a/src/symmetric_crypto/aes_256_gcm_pure/mod.rs +++ b/src/symmetric_crypto/aes_256_gcm_pure/mod.rs @@ -58,15 +58,12 @@ impl Dem for Aes256GcmCrypto { // allocate correct byte number let mut res: Vec = Vec::with_capacity(plaintext.len() + Self::ENCRYPTION_OVERHEAD); res.extend_from_slice(nonce.as_bytes()); - res.append( - &mut encrypt_combined( - secret_key.as_bytes(), - plaintext, - nonce.as_bytes(), - additional_data, - ) - .map_err(|err| CryptoCoreError::EncryptionError(err.to_string()))?, - ); + res.append(&mut encrypt_combined( + secret_key.as_bytes(), + plaintext, + nonce.as_bytes(), + additional_data, + )?); Ok(res) } @@ -98,7 +95,6 @@ impl Dem for Aes256GcmCrypto { nonce.as_bytes(), additional_data, ) - .map_err(|err| CryptoCoreError::EncryptionError(err.to_string())) } }