9#include "InternalCryptLib.h"
10#include <openssl/sha.h>
27 return (
UINTN)(
sizeof (SHA512_CTX));
45 OUT VOID *Sha384Context
51 if (Sha384Context ==
NULL) {
58 return (BOOLEAN)(SHA384_Init ((SHA512_CTX *)Sha384Context));
80 OUT VOID *NewSha384Context
86 if ((Sha384Context ==
NULL) || (NewSha384Context ==
NULL)) {
90 CopyMem (NewSha384Context, Sha384Context,
sizeof (SHA512_CTX));
116 IN OUT VOID *Sha384Context,
124 if (Sha384Context ==
NULL) {
131 if ((Data ==
NULL) && (DataSize != 0)) {
138 return (BOOLEAN)(SHA384_Update ((SHA512_CTX *)Sha384Context, Data, DataSize));
164 IN OUT VOID *Sha384Context,
171 if ((Sha384Context ==
NULL) || (HashValue ==
NULL)) {
178 return (BOOLEAN)(SHA384_Final (HashValue, (SHA512_CTX *)Sha384Context));
212 if (HashValue ==
NULL) {
216 if ((Data ==
NULL) && (DataSize != 0)) {
223 if (!SHA384_Init (&Context)) {
227 if (!SHA384_Update (&Context, Data, DataSize)) {
231 if (!SHA384_Final (HashValue, &Context)) {
253 return (
UINTN)(
sizeof (SHA512_CTX));
271 OUT VOID *Sha512Context
277 if (Sha512Context ==
NULL) {
284 return (BOOLEAN)(SHA512_Init ((SHA512_CTX *)Sha512Context));
306 OUT VOID *NewSha512Context
312 if ((Sha512Context ==
NULL) || (NewSha512Context ==
NULL)) {
316 CopyMem (NewSha512Context, Sha512Context,
sizeof (SHA512_CTX));
342 IN OUT VOID *Sha512Context,
350 if (Sha512Context ==
NULL) {
357 if ((Data ==
NULL) && (DataSize != 0)) {
364 return (BOOLEAN)(SHA512_Update ((SHA512_CTX *)Sha512Context, Data, DataSize));
390 IN OUT VOID *Sha512Context,
397 if ((Sha512Context ==
NULL) || (HashValue ==
NULL)) {
404 return (BOOLEAN)(SHA384_Final (HashValue, (SHA512_CTX *)Sha512Context));
438 if (HashValue ==
NULL) {
442 if ((Data ==
NULL) && (DataSize != 0)) {
449 if (!SHA512_Init (&Context)) {
453 if (!SHA512_Update (&Context, Data, DataSize)) {
457 if (!SHA512_Final (HashValue, &Context)) {
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
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)