9#include "InternalCryptLib.h"
10#include <mbedtls/sha512.h>
24 return (
UINTN)(
sizeof (mbedtls_sha512_context));
42 OUT VOID *Sha384Context
47 if (Sha384Context ==
NULL) {
51 mbedtls_sha512_init (Sha384Context);
53 Ret = mbedtls_sha512_starts (Sha384Context,
TRUE);
80 OUT VOID *NewSha384Context
83 if ((Sha384Context ==
NULL) || (NewSha384Context ==
NULL)) {
87 mbedtls_sha512_clone (NewSha384Context, Sha384Context);
113 IN OUT VOID *Sha384Context,
120 if (Sha384Context ==
NULL) {
124 if ((Data ==
NULL) && (DataSize != 0)) {
128 Ret = mbedtls_sha512_update (Sha384Context, Data, DataSize);
159 IN OUT VOID *Sha384Context,
165 if ((Sha384Context ==
NULL) || (HashValue ==
NULL)) {
169 Ret = mbedtls_sha512_finish (Sha384Context, HashValue);
170 mbedtls_sha512_free (Sha384Context);
206 if (HashValue ==
NULL) {
210 if ((Data ==
NULL) && (DataSize != 0)) {
214 Ret = mbedtls_sha512 (Data, DataSize, HashValue,
TRUE);
234 return (
UINTN)(
sizeof (mbedtls_sha512_context));
252 OUT VOID *Sha512Context
257 if (Sha512Context ==
NULL) {
261 mbedtls_sha512_init (Sha512Context);
263 Ret = mbedtls_sha512_starts (Sha512Context,
FALSE);
290 OUT VOID *NewSha512Context
293 if ((Sha512Context ==
NULL) || (NewSha512Context ==
NULL)) {
297 mbedtls_sha512_clone (NewSha512Context, Sha512Context);
323 IN OUT VOID *Sha512Context,
330 if (Sha512Context ==
NULL) {
334 if ((Data ==
NULL) && (DataSize != 0)) {
338 Ret = mbedtls_sha512_update (Sha512Context, Data, DataSize);
369 IN OUT VOID *Sha512Context,
375 if ((Sha512Context ==
NULL) || (HashValue ==
NULL)) {
379 Ret = mbedtls_sha512_finish (Sha512Context, HashValue);
380 mbedtls_sha512_free (Sha512Context);
416 if (HashValue ==
NULL) {
420 if ((Data ==
NULL) && (DataSize != 0)) {
424 Ret = mbedtls_sha512 (Data, DataSize, HashValue,
FALSE);
UINTN EFIAPI Sha384GetContextSize(VOID)
BOOLEAN EFIAPI Sha512HashAll(IN CONST VOID *Data, IN UINTN DataSize, OUT UINT8 *HashValue)
BOOLEAN EFIAPI Sha512Final(IN OUT VOID *Sha512Context, OUT UINT8 *HashValue)
BOOLEAN EFIAPI Sha384Duplicate(IN CONST VOID *Sha384Context, OUT VOID *NewSha384Context)
UINTN EFIAPI Sha512GetContextSize(VOID)
BOOLEAN EFIAPI Sha512Init(OUT VOID *Sha512Context)
BOOLEAN EFIAPI Sha384HashAll(IN CONST VOID *Data, IN UINTN DataSize, OUT UINT8 *HashValue)
BOOLEAN EFIAPI Sha384Update(IN OUT VOID *Sha384Context, IN CONST VOID *Data, IN UINTN DataSize)
BOOLEAN EFIAPI Sha512Duplicate(IN CONST VOID *Sha512Context, OUT VOID *NewSha512Context)
BOOLEAN EFIAPI Sha384Final(IN OUT VOID *Sha384Context, OUT UINT8 *HashValue)
BOOLEAN EFIAPI Sha384Init(OUT VOID *Sha384Context)
BOOLEAN EFIAPI Sha512Update(IN OUT VOID *Sha512Context, IN CONST VOID *Data, IN UINTN DataSize)