9#include "InternalCryptLib.h"
10#include <mbedtls/aes.h>
28 return (
UINTN)(2 *
sizeof (mbedtls_aes_context));
59 mbedtls_aes_context *AesCtx;
64 if ((AesContext ==
NULL) || (Key ==
NULL) || ((KeyLength != 128) && (KeyLength != 192) && (KeyLength != 256))) {
71 AesCtx = (mbedtls_aes_context *)AesContext;
72 if (mbedtls_aes_setkey_enc (AesCtx, Key, (UINT32)KeyLength) != 0) {
76 if (mbedtls_aes_setkey_dec (AesCtx + 1, Key, (UINT32)KeyLength) != 0) {
120 mbedtls_aes_context *AesCtx;
130 if ((Ivec ==
NULL) || (Output ==
NULL) || (InputSize > INT_MAX)) {
134 AesCtx = (mbedtls_aes_context *)AesContext;
140 if (mbedtls_aes_crypt_cbc (
192 mbedtls_aes_context *AesCtx;
202 if ((Ivec ==
NULL) || (Output ==
NULL) || (InputSize > INT_MAX)) {
206 AesCtx = (mbedtls_aes_context *)AesContext;
212 if (mbedtls_aes_crypt_cbc (
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)