TianoCore EDK2 master
|
#include "AesCore.h"
Go to the source code of this file.
Data Structures | |
struct | AES_KEY |
Macros | |
#define | AES_NB 4 |
#define | ROTATE_RIGHT32(x, n) (((x) >> (n)) | ((x) << (32-(n)))) |
#define | LOAD32H(x, y) |
#define | STORE32H(x, y) |
#define | AES_FT0(x) AesForwardTable[x] |
#define | AES_FT1(x) ROTATE_RIGHT32(AesForwardTable[x], 8) |
#define | AES_FT2(x) ROTATE_RIGHT32(AesForwardTable[x], 16) |
#define | AES_FT3(x) ROTATE_RIGHT32(AesForwardTable[x], 24) |
Functions | |
EFI_STATUS EFIAPI | AesExpandKey (IN UINT8 *Key, IN UINTN KeyLenInBits, OUT AES_KEY *AesKey) |
EFI_STATUS EFIAPI | AesEncrypt (IN UINT8 *Key, IN UINT8 *InData, OUT UINT8 *OutData) |
Variables | |
GLOBAL_REMOVE_IF_UNREFERENCED CONST UINT32 | AesForwardTable [] |
GLOBAL_REMOVE_IF_UNREFERENCED CONST UINT32 | Rcon [] |
Core Primitive Implementation of the Advanced Encryption Standard (AES) algorithm. Refer to FIPS PUB 197 ("Advanced Encryption Standard (AES)") for detailed algorithm description of AES.
Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file AesCore.c.
#define AES_FT2 | ( | x | ) | ROTATE_RIGHT32(AesForwardTable[x], 16) |
#define AES_FT3 | ( | x | ) | ROTATE_RIGHT32(AesForwardTable[x], 24) |
#define LOAD32H | ( | x, | |
y | |||
) |
#define ROTATE_RIGHT32 | ( | x, | |
n | |||
) | (((x) >> (n)) | ((x) << (32-(n)))) |
#define STORE32H | ( | x, | |
y | |||
) |
EFI_STATUS EFIAPI AesEncrypt | ( | IN UINT8 * | Key, |
IN UINT8 * | InData, | ||
OUT UINT8 * | OutData | ||
) |
Encrypts one single block data (128 bits) with AES algorithm.
[in] | Key | AES symmetric key buffer. |
[in] | InData | One block of input plaintext to be encrypted. |
[out] | OutData | Encrypted output ciphertext. |
EFI_SUCCESS | AES Block Encryption succeeded. |
EFI_INVALID_PARAMETER | One or more parameters are invalid. |
AES Key Expansion. This function expands the cipher key into encryption schedule.
[in] | Key | AES symmetric key buffer. |
[in] | KeyLenInBits | Key length in bits (128, 192, or 256). |
[out] | AesKey | Expanded AES Key schedule for encryption. |
EFI_SUCCESS | AES key expansion succeeded. |
EFI_INVALID_PARAMETER | Unsupported key length. |
GLOBAL_REMOVE_IF_UNREFERENCED CONST UINT32 AesForwardTable[] |
GLOBAL_REMOVE_IF_UNREFERENCED CONST UINT32 Rcon[] |