TianoCore EDK2 master
Loading...
Searching...
No Matches
Hash2.h
Go to the documentation of this file.
1
15#ifndef __EFI_HASH2_PROTOCOL_H__
16#define __EFI_HASH2_PROTOCOL_H__
17
18#define EFI_HASH2_SERVICE_BINDING_PROTOCOL_GUID \
19 { \
20 0xda836f8d, 0x217f, 0x4ca0, { 0x99, 0xc2, 0x1c, 0xa4, 0xe1, 0x60, 0x77, 0xea } \
21 }
22
23#define EFI_HASH2_PROTOCOL_GUID \
24 { \
25 0x55b1d734, 0xc5e1, 0x49db, { 0x96, 0x47, 0xb1, 0x6a, 0xfb, 0xe, 0x30, 0x5b } \
26 }
27
28#include <Protocol/Hash.h>
29
30//
31// NOTE:
32// Algorithms EFI_HASH_ALGORITHM_SHA1_NOPAD and
33// EFI_HASH_ALGORITHM_SHA256_NOPAD_GUID are not compatible with
34// EFI_HASH2_PROTOCOL and will return EFI_UNSUPPORTED if used with any
35// EFI_HASH2_PROTOCOL function.
36//
37
38//
39// Note: SHA-1 and MD5 are included for backwards compatibility.
40// New driver implementations are encouraged to consider stronger algorithms.
41//
42
44
45typedef UINT8 EFI_MD5_HASH2[16];
46typedef UINT8 EFI_SHA1_HASH2[20];
47typedef UINT8 EFI_SHA224_HASH2[28];
48typedef UINT8 EFI_SHA256_HASH2[32];
49typedef UINT8 EFI_SHA384_HASH2[48];
50typedef UINT8 EFI_SHA512_HASH2[64];
51
52typedef union {
53 EFI_MD5_HASH2 Md5Hash;
54 EFI_SHA1_HASH2 Sha1Hash;
55 EFI_SHA224_HASH2 Sha224Hash;
56 EFI_SHA256_HASH2 Sha256Hash;
57 EFI_SHA384_HASH2 Sha384Hash;
58 EFI_SHA512_HASH2 Sha512Hash;
60
74typedef
78 IN CONST EFI_GUID *HashAlgorithm,
79 OUT UINTN *HashSize
80 );
81
102typedef
104(EFIAPI *EFI_HASH2_HASH)(
106 IN CONST EFI_GUID *HashAlgorithm,
107 IN CONST UINT8 *Message,
108 IN UINTN MessageSize,
110 );
111
128typedef
130(EFIAPI *EFI_HASH2_HASH_INIT)(
132 IN CONST EFI_GUID *HashAlgorithm
133 );
134
150typedef
152(EFIAPI *EFI_HASH2_HASH_UPDATE)(
154 IN CONST UINT8 *Message,
155 IN UINTN MessageSize
156 );
157
174typedef
176(EFIAPI *EFI_HASH2_HASH_FINAL)(
179 );
180
186 EFI_HASH2_GET_HASH_SIZE GetHashSize;
187 EFI_HASH2_HASH Hash;
188 EFI_HASH2_HASH_INIT HashInit;
189 EFI_HASH2_HASH_UPDATE HashUpdate;
190 EFI_HASH2_HASH_FINAL HashFinal;
191};
192
193extern EFI_GUID gEfiHash2ServiceBindingProtocolGuid;
194extern EFI_GUID gEfiHash2ProtocolGuid;
195
196#endif
UINT64 UINTN
#define CONST
Definition: Base.h:259
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
EFI_STATUS(EFIAPI * EFI_HASH2_HASH_FINAL)(IN CONST EFI_HASH2_PROTOCOL *This, IN OUT EFI_HASH2_OUTPUT *Hash)
Definition: Hash2.h:176
EFI_STATUS(EFIAPI * EFI_HASH2_HASH_INIT)(IN CONST EFI_HASH2_PROTOCOL *This, IN CONST EFI_GUID *HashAlgorithm)
Definition: Hash2.h:130
EFI_STATUS(EFIAPI * EFI_HASH2_HASH)(IN CONST EFI_HASH2_PROTOCOL *This, IN CONST EFI_GUID *HashAlgorithm, IN CONST UINT8 *Message, IN UINTN MessageSize, IN OUT EFI_HASH2_OUTPUT *Hash)
Definition: Hash2.h:104
EFI_STATUS(EFIAPI * EFI_HASH2_GET_HASH_SIZE)(IN CONST EFI_HASH2_PROTOCOL *This, IN CONST EFI_GUID *HashAlgorithm, OUT UINTN *HashSize)
Definition: Hash2.h:76
EFI_STATUS(EFIAPI * EFI_HASH2_HASH_UPDATE)(IN CONST EFI_HASH2_PROTOCOL *This, IN CONST UINT8 *Message, IN UINTN MessageSize)
Definition: Hash2.h:152
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
Definition: Base.h:213