9#include "InternalCryptLib.h"
10#include "internal/sm3.h"
27 return (
UINTN)(
sizeof (SM3_CTX));
51 if (Sm3Context ==
NULL) {
58 ossl_sm3_init ((SM3_CTX *)Sm3Context);
81 OUT VOID *NewSm3Context
87 if ((Sm3Context ==
NULL) || (NewSm3Context ==
NULL)) {
91 CopyMem (NewSm3Context, Sm3Context,
sizeof (SM3_CTX));
117 IN OUT VOID *Sm3Context,
125 if (Sm3Context ==
NULL) {
132 if ((Data ==
NULL) && (DataSize != 0)) {
139 ossl_sm3_update ((SM3_CTX *)Sm3Context, Data, DataSize);
167 IN OUT VOID *Sm3Context,
174 if ((Sm3Context ==
NULL) || (HashValue ==
NULL)) {
181 ossl_sm3_final (HashValue, (SM3_CTX *)Sm3Context);
217 if (HashValue ==
NULL) {
221 if ((Data ==
NULL) && (DataSize != 0)) {
228 ossl_sm3_init (&Ctx);
230 ossl_sm3_update (&Ctx, Data, DataSize);
232 ossl_sm3_final (HashValue, &Ctx);
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
BOOLEAN EFIAPI Sm3Duplicate(IN CONST VOID *Sm3Context, OUT VOID *NewSm3Context)
UINTN EFIAPI Sm3GetContextSize(VOID)
BOOLEAN EFIAPI Sm3Update(IN OUT VOID *Sm3Context, IN CONST VOID *Data, IN UINTN DataSize)
BOOLEAN EFIAPI Sm3Final(IN OUT VOID *Sm3Context, OUT UINT8 *HashValue)
BOOLEAN EFIAPI Sm3HashAll(IN CONST VOID *Data, IN UINTN DataSize, OUT UINT8 *HashValue)
BOOLEAN EFIAPI Sm3Init(OUT VOID *Sm3Context)