From 96dbabae8da27539ce1fe8411dc3c31d4c021906 Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Wed, 4 Sep 2024 13:20:51 +0000 Subject: [PATCH] pv/crypto: Improve comment about the AES 256 GCM key MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The size of an AES key depends on the mode of operation, so add this information at least in the comments, as the API cannot be changed as it is already published. Signed-off-by: Marc Hartmayer Reviewed-by: Steffen Eiden Signed-off-by: Jan Höppner --- rust/pv/src/crypto.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rust/pv/src/crypto.rs b/rust/pv/src/crypto.rs index 2087070c..bb9903a9 100644 --- a/rust/pv/src/crypto.rs +++ b/rust/pv/src/crypto.rs @@ -18,7 +18,7 @@ use openssl::{ }; use std::{convert::TryInto, ops::Range}; -/// An AES256-key that will purge itself out of the memory when going out of scope +/// An AES256-GCM key that will purge itself out of the memory when going out of scope pub type Aes256Key = Confidential<[u8; 32]>; pub(crate) const AES_256_GCM_TAG_SIZE: usize = 16; @@ -31,7 +31,7 @@ pub(crate) type Sha256Hash = [u8; SHA_256_HASH_SIZE as usize]; #[non_exhaustive] #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum SymKeyType { - /// AES 256 key (32 bytes) + /// AES 256 GCM key (32 bytes) Aes256, } @@ -39,7 +39,7 @@ pub enum SymKeyType { #[non_exhaustive] #[derive(Debug, Clone, PartialEq, Eq)] pub enum SymKey { - /// AES 256 key (32 bytes) + /// AES 256 GCM key (32 bytes) Aes256(Aes256Key), }