TianoCore EDK2 master
|
#include "InternalCryptLib.h"
#include <mbedtls/gcm.h>
Go to the source code of this file.
Functions | |
BOOLEAN EFIAPI | AeadAesGcmEncrypt (IN CONST UINT8 *Key, IN UINTN KeySize, IN CONST UINT8 *Iv, IN UINTN IvSize, IN CONST UINT8 *AData, IN UINTN ADataSize, IN CONST UINT8 *DataIn, IN UINTN DataInSize, OUT UINT8 *TagOut, IN UINTN TagSize, OUT UINT8 *DataOut, OUT UINTN *DataOutSize) |
BOOLEAN EFIAPI | AeadAesGcmDecrypt (IN CONST UINT8 *Key, IN UINTN KeySize, IN CONST UINT8 *Iv, IN UINTN IvSize, IN CONST UINT8 *AData, IN UINTN ADataSize, IN CONST UINT8 *DataIn, IN UINTN DataInSize, IN CONST UINT8 *Tag, IN UINTN TagSize, OUT UINT8 *DataOut, OUT UINTN *DataOutSize) |
AEAD (AES-GCM) Wrapper Implementation over MbedTLS.
RFC 5116 - An Interface and Algorithms for Authenticated Encryption NIST SP800-38d - Cipher Modes of Operation: Galois / Counter Mode(GCM) and GMAC
Copyright (c) 2024, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file CryptAeadAesGcm.c.
BOOLEAN EFIAPI AeadAesGcmDecrypt | ( | IN CONST UINT8 * | Key, |
IN UINTN | KeySize, | ||
IN CONST UINT8 * | Iv, | ||
IN UINTN | IvSize, | ||
IN CONST UINT8 * | AData, | ||
IN UINTN | ADataSize, | ||
IN CONST UINT8 * | DataIn, | ||
IN UINTN | DataInSize, | ||
IN CONST UINT8 * | Tag, | ||
IN UINTN | TagSize, | ||
OUT UINT8 * | DataOut, | ||
OUT UINTN * | DataOutSize | ||
) |
Performs AEAD AES-GCM authenticated decryption on a data buffer and additional authenticated data (AAD).
IvSize must be 12, otherwise FALSE is returned. KeySize must be 16, 24 or 32, otherwise FALSE is returned. TagSize must be 12, 13, 14, 15, 16, otherwise FALSE is returned. If additional authenticated data verification fails, FALSE is returned.
[in] | Key | Pointer to the encryption key. |
[in] | KeySize | Size of the encryption key in bytes. |
[in] | Iv | Pointer to the IV value. |
[in] | IvSize | Size of the IV value in bytes. |
[in] | AData | Pointer to the additional authenticated data (AAD). |
[in] | ADataSize | Size of the additional authenticated data (AAD) in bytes. |
[in] | DataIn | Pointer to the input data buffer to be decrypted. |
[in] | DataInSize | Size of the input data buffer in bytes. |
[in] | Tag | Pointer to a buffer that contains the authentication tag. |
[in] | TagSize | Size of the authentication tag in bytes. |
[out] | DataOut | Pointer to a buffer that receives the decryption output. |
[out] | DataOutSize | Size of the output data buffer in bytes. |
TRUE | AEAD AES-GCM authenticated decryption succeeded. |
FALSE | AEAD AES-GCM authenticated decryption failed. |
Definition at line 149 of file CryptAeadAesGcm.c.
BOOLEAN EFIAPI AeadAesGcmEncrypt | ( | IN CONST UINT8 * | Key, |
IN UINTN | KeySize, | ||
IN CONST UINT8 * | Iv, | ||
IN UINTN | IvSize, | ||
IN CONST UINT8 * | AData, | ||
IN UINTN | ADataSize, | ||
IN CONST UINT8 * | DataIn, | ||
IN UINTN | DataInSize, | ||
OUT UINT8 * | TagOut, | ||
IN UINTN | TagSize, | ||
OUT UINT8 * | DataOut, | ||
OUT UINTN * | DataOutSize | ||
) |
Performs AEAD AES-GCM authenticated encryption on a data buffer and additional authenticated data (AAD).
IvSize must be 12, otherwise FALSE is returned. KeySize must be 16, 24 or 32, otherwise FALSE is returned. TagSize must be 12, 13, 14, 15, 16, otherwise FALSE is returned.
[in] | Key | Pointer to the encryption key. |
[in] | KeySize | Size of the encryption key in bytes. |
[in] | Iv | Pointer to the IV value. |
[in] | IvSize | Size of the IV value in bytes. |
[in] | AData | Pointer to the additional authenticated data (AAD). |
[in] | ADataSize | Size of the additional authenticated data (AAD) in bytes. |
[in] | DataIn | Pointer to the input data buffer to be encrypted. |
[in] | DataInSize | Size of the input data buffer in bytes. |
[out] | TagOut | Pointer to a buffer that receives the authentication tag output. |
[in] | TagSize | Size of the authentication tag in bytes. |
[out] | DataOut | Pointer to a buffer that receives the encryption output. |
[out] | DataOutSize | Size of the output data buffer in bytes. |
TRUE | AEAD AES-GCM authenticated encryption succeeded. |
FALSE | AEAD AES-GCM authenticated encryption failed. |
Definition at line 41 of file CryptAeadAesGcm.c.