9#include "InternalCryptLib.h"
10#include <openssl/sha.h>
27 return (
UINTN)(
sizeof (SHA256_CTX));
45 OUT VOID *Sha256Context
51 if (Sha256Context ==
NULL) {
58 return (BOOLEAN)(SHA256_Init ((SHA256_CTX *)Sha256Context));
78 OUT VOID *NewSha256Context
84 if ((Sha256Context ==
NULL) || (NewSha256Context ==
NULL)) {
88 CopyMem (NewSha256Context, Sha256Context,
sizeof (SHA256_CTX));
114 IN OUT VOID *Sha256Context,
122 if (Sha256Context ==
NULL) {
129 if ((Data ==
NULL) && (DataSize != 0)) {
136 return (BOOLEAN)(SHA256_Update ((SHA256_CTX *)Sha256Context, Data, DataSize));
162 IN OUT VOID *Sha256Context,
169 if ((Sha256Context ==
NULL) || (HashValue ==
NULL)) {
176 return (BOOLEAN)(SHA256_Final (HashValue, (SHA256_CTX *)Sha256Context));
210 if (HashValue ==
NULL) {
214 if ((Data ==
NULL) && (DataSize != 0)) {
221 if (!SHA256_Init (&Context)) {
225 if (!SHA256_Update (&Context, Data, DataSize)) {
229 if (!SHA256_Final (HashValue, &Context)) {
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
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)