9#include "InternalCryptLib.h"
10#include <mbedtls/sha256.h>
24 return (
UINTN)(
sizeof (mbedtls_sha256_context));
42 OUT VOID *Sha256Context
47 if (Sha256Context ==
NULL) {
51 mbedtls_sha256_init (Sha256Context);
53 Ret = mbedtls_sha256_starts (Sha256Context,
FALSE);
78 OUT VOID *NewSha256Context
81 if ((Sha256Context ==
NULL) || (NewSha256Context ==
NULL)) {
85 mbedtls_sha256_clone (NewSha256Context, Sha256Context);
111 IN OUT VOID *Sha256Context,
118 if (Sha256Context ==
NULL) {
122 if ((Data ==
NULL) && (DataSize != 0)) {
126 Ret = mbedtls_sha256_update (Sha256Context, Data, DataSize);
157 IN OUT VOID *Sha256Context,
163 if ((Sha256Context ==
NULL) || (HashValue ==
NULL)) {
167 Ret = mbedtls_sha256_finish (Sha256Context, HashValue);
168 mbedtls_sha256_free (Sha256Context);
204 if (HashValue ==
NULL) {
208 if ((Data ==
NULL) && (DataSize != 0)) {
212 Ret = mbedtls_sha256 (Data, DataSize, HashValue,
FALSE);
UINTN EFIAPI Sha256GetContextSize(VOID)
BOOLEAN EFIAPI Sha256Init(OUT VOID *Sha256Context)
BOOLEAN EFIAPI Sha256Final(IN OUT VOID *Sha256Context, OUT UINT8 *HashValue)
BOOLEAN EFIAPI Sha256Duplicate(IN CONST VOID *Sha256Context, OUT VOID *NewSha256Context)
BOOLEAN EFIAPI Sha256HashAll(IN CONST VOID *Data, IN UINTN DataSize, OUT UINT8 *HashValue)
BOOLEAN EFIAPI Sha256Update(IN OUT VOID *Sha256Context, IN CONST VOID *Data, IN UINTN DataSize)