9#include "InternalCryptLib.h"
10#include <openssl/aes.h>
64 if ((AesContext ==
NULL) || (Key ==
NULL) || ((KeyLength != 128) && (KeyLength != 192) && (KeyLength != 256))) {
72 if (AES_set_encrypt_key (Key, (UINT32)KeyLength, AesKey) != 0) {
76 if (AES_set_decrypt_key (Key, (UINT32)KeyLength, AesKey + 1) != 0) {
130 if ((Ivec ==
NULL) || (Output ==
NULL) || (InputSize > INT_MAX)) {
134 AesKey = (
AES_KEY *)AesContext;
140 AES_cbc_encrypt (
Input, Output, (UINT32)InputSize, AesKey, IvecBuffer, AES_ENCRYPT);
192 if ((Ivec ==
NULL) || (Output ==
NULL) || (InputSize > INT_MAX)) {
196 AesKey = (
AES_KEY *)AesContext;
202 AES_cbc_encrypt (
Input, Output, (UINT32)InputSize, AesKey + 1, IvecBuffer, AES_DECRYPT);
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
BOOLEAN EFIAPI AesInit(OUT VOID *AesContext, IN CONST UINT8 *Key, IN UINTN KeyLength)
UINTN EFIAPI AesGetContextSize(VOID)
BOOLEAN EFIAPI AesCbcEncrypt(IN VOID *AesContext, IN CONST UINT8 *Input, IN UINTN InputSize, IN CONST UINT8 *Ivec, OUT UINT8 *Output)
BOOLEAN EFIAPI AesCbcDecrypt(IN VOID *AesContext, IN CONST UINT8 *Input, IN UINTN InputSize, IN CONST UINT8 *Ivec, OUT UINT8 *Output)
VOID EFIAPI Input(IN CHAR16 *Prompt OPTIONAL, OUT CHAR16 *InStr, IN UINTN StrLen)