rust/pv: Add decrypt and HMAC function

Add a function to decrypt a block with aes_gcm.
Add functionality to perform HMAC operations.

Acked-by: Qi Feng Huo <huoqif@cn.ibm.com>
Acked-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
This commit is contained in:
Steffen Eiden
2024-02-23 16:47:22 +01:00
parent c46a066827
commit e152b554f5
2 changed files with 105 additions and 13 deletions

View File

@@ -50,6 +50,9 @@ pub enum Error {
#[error("Customer Communication Key must be 32 bytes long")]
CckSize,
#[error("Decryption failed. Probably due to a GCM tag mismatch.")]
GcmTagMismatch,
#[error("Invalid {0} user-data for signing provided. Max {} bytes allowed", .0.max())]
AsrcbInvSgnUserData(UserDataType),