TianoCore EDK2 master
Loading...
Searching...
No Matches
CryptAeadAesGcmNull.c File Reference
#include "InternalCryptLib.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)
 

Detailed Description

AEAD Wrapper Implementation which does not provide real capabilities.

Copyright (c) 2023, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file CryptAeadAesGcmNull.c.

Function Documentation

◆ AeadAesGcmDecrypt()

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.

Parameters
[in]KeyPointer to the encryption key.
[in]KeySizeSize of the encryption key in bytes.
[in]IvPointer to the IV value.
[in]IvSizeSize of the IV value in bytes.
[in]ADataPointer to the additional authenticated data (AAD).
[in]ADataSizeSize of the additional authenticated data (AAD) in bytes.
[in]DataInPointer to the input data buffer to be decrypted.
[in]DataInSizeSize of the input data buffer in bytes.
[in]TagPointer to a buffer that contains the authentication tag.
[in]TagSizeSize of the authentication tag in bytes.
[out]DataOutPointer to a buffer that receives the decryption output.
[out]DataOutSizeSize of the output data buffer in bytes.
Return values
TRUEAEAD AES-GCM authenticated decryption succeeded.
FALSEAEAD AES-GCM authenticated decryption failed.

Definition at line 83 of file CryptAeadAesGcmNull.c.

◆ AeadAesGcmEncrypt()

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.

Parameters
[in]KeyPointer to the encryption key.
[in]KeySizeSize of the encryption key in bytes.
[in]IvPointer to the IV value.
[in]IvSizeSize of the IV value in bytes.
[in]ADataPointer to the additional authenticated data (AAD).
[in]ADataSizeSize of the additional authenticated data (AAD) in bytes.
[in]DataInPointer to the input data buffer to be encrypted.
[in]DataInSizeSize of the input data buffer in bytes.
[out]TagOutPointer to a buffer that receives the authentication tag output.
[in]TagSizeSize of the authentication tag in bytes.
[out]DataOutPointer to a buffer that receives the encryption output.
[out]DataOutSizeSize of the output data buffer in bytes.
Return values
TRUEAEAD AES-GCM authenticated encryption succeeded.
FALSEAEAD AES-GCM authenticated encryption failed.

Definition at line 37 of file CryptAeadAesGcmNull.c.