Skip to content

Commit

Permalink
Corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
tbrezot committed Sep 12, 2022
1 parent 6f35a5b commit 70143e0
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/symmetric_crypto/aes_256_gcm_pure/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,12 @@ impl Dem<KEY_LENGTH> for Aes256GcmCrypto {
// allocate correct byte number
let mut res: Vec<u8> = 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)
}

Expand Down Expand Up @@ -98,7 +95,6 @@ impl Dem<KEY_LENGTH> for Aes256GcmCrypto {
nonce.as_bytes(),
additional_data,
)
.map_err(|err| CryptoCoreError::EncryptionError(err.to_string()))
}
}

Expand Down

0 comments on commit 70143e0

Please sign in to comment.