TianoCore EDK2 master
Loading...
Searching...
No Matches
Hash2.h File Reference
#include <Protocol/Hash.h>

Go to the source code of this file.

Data Structures

union  EFI_HASH2_OUTPUT
 
struct  _EFI_HASH2_PROTOCOL
 

Macros

#define EFI_HASH2_SERVICE_BINDING_PROTOCOL_GUID
 
#define EFI_HASH2_PROTOCOL_GUID
 

Typedefs

typedef struct _EFI_HASH2_PROTOCOL EFI_HASH2_PROTOCOL
 
typedef UINT8 EFI_MD5_HASH2[16]
 
typedef UINT8 EFI_SHA1_HASH2[20]
 
typedef UINT8 EFI_SHA224_HASH2[28]
 
typedef UINT8 EFI_SHA256_HASH2[32]
 
typedef UINT8 EFI_SHA384_HASH2[48]
 
typedef UINT8 EFI_SHA512_HASH2[64]
 
typedef EFI_STATUS(EFIAPI * EFI_HASH2_GET_HASH_SIZE) (IN CONST EFI_HASH2_PROTOCOL *This, IN CONST EFI_GUID *HashAlgorithm, OUT UINTN *HashSize)
 
typedef 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)
 
typedef EFI_STATUS(EFIAPI * EFI_HASH2_HASH_INIT) (IN CONST EFI_HASH2_PROTOCOL *This, IN CONST EFI_GUID *HashAlgorithm)
 
typedef EFI_STATUS(EFIAPI * EFI_HASH2_HASH_UPDATE) (IN CONST EFI_HASH2_PROTOCOL *This, IN CONST UINT8 *Message, IN UINTN MessageSize)
 
typedef EFI_STATUS(EFIAPI * EFI_HASH2_HASH_FINAL) (IN CONST EFI_HASH2_PROTOCOL *This, IN OUT EFI_HASH2_OUTPUT *Hash)
 

Variables

EFI_GUID gEfiHash2ServiceBindingProtocolGuid
 
EFI_GUID gEfiHash2ProtocolGuid
 

Detailed Description

EFI_HASH2_SERVICE_BINDING_PROTOCOL as defined in UEFI 2.5. EFI_HASH2_PROTOCOL as defined in UEFI 2.5. The EFI Hash2 Service Binding Protocol is used to locate hashing services support provided by a driver and to create and destroy instances of the EFI Hash2 Protocol so that a multiple drivers can use the underlying hashing services. EFI_HASH2_PROTOCOL describes hashing functions for which the algorithm-required message padding and finalization are performed by the supporting driver.

Copyright (c) 2015, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file Hash2.h.

Macro Definition Documentation

◆ EFI_HASH2_PROTOCOL_GUID

#define EFI_HASH2_PROTOCOL_GUID
Value:
{ \
0x55b1d734, 0xc5e1, 0x49db, { 0x96, 0x47, 0xb1, 0x6a, 0xfb, 0xe, 0x30, 0x5b } \
}

Definition at line 23 of file Hash2.h.

◆ EFI_HASH2_SERVICE_BINDING_PROTOCOL_GUID

#define EFI_HASH2_SERVICE_BINDING_PROTOCOL_GUID
Value:
{ \
0xda836f8d, 0x217f, 0x4ca0, { 0x99, 0xc2, 0x1c, 0xa4, 0xe1, 0x60, 0x77, 0xea } \
}

Definition at line 18 of file Hash2.h.

Typedef Documentation

◆ EFI_HASH2_GET_HASH_SIZE

typedef EFI_STATUS(EFIAPI * EFI_HASH2_GET_HASH_SIZE) (IN CONST EFI_HASH2_PROTOCOL *This, IN CONST EFI_GUID *HashAlgorithm, OUT UINTN *HashSize)

Returns the size of the hash which results from a specific algorithm.

Parameters
[in]ThisPoints to this instance of EFI_HASH2_PROTOCOL.
[in]HashAlgorithmPoints to the EFI_GUID which identifies the algorithm to use.
[out]HashSizeHolds the returned size of the algorithm's hash.
Return values
EFI_SUCCESSHash size returned successfully.
EFI_INVALID_PARAMETERThis or HashSize is NULL.
EFI_UNSUPPORTEDThe algorithm specified by HashAlgorithm is not supported by this driver or HashAlgorithm is null.

Definition at line 75 of file Hash2.h.

◆ EFI_HASH2_HASH

typedef 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)

Creates a hash for the specified message text. The hash is not extendable. The output is final with any algorithm-required padding added by the function.

Parameters
[in]ThisPoints to this instance of EFI_HASH2_PROTOCOL.
[in]HashAlgorithmPoints to the EFI_GUID which identifies the algorithm to use.
[in]MessagePoints to the start of the message.
[in]MessageSizeThe size of Message, in bytes.
[in,out]HashOn input, points to a caller-allocated buffer of the size returned by GetHashSize() for the specified HashAlgorithm. On output, the buffer holds the resulting hash computed from the message.
Return values
EFI_SUCCESSHash returned successfully.
EFI_INVALID_PARAMETERThis or Hash is NULL.
EFI_UNSUPPORTEDThe algorithm specified by HashAlgorithm is not supported by this driver or HashAlgorithm is Null.
EFI_OUT_OF_RESOURCESSome resource required by the function is not available or MessageSize is greater than platform maximum.

Definition at line 103 of file Hash2.h.

◆ EFI_HASH2_HASH_FINAL

typedef EFI_STATUS(EFIAPI * EFI_HASH2_HASH_FINAL) (IN CONST EFI_HASH2_PROTOCOL *This, IN OUT EFI_HASH2_OUTPUT *Hash)

Finalizes a hash operation in progress and returns calculation result. The output is final with any necessary padding added by the function. The hash may not be further updated or extended after HashFinal().

Parameters
[in]ThisPoints to this instance of EFI_HASH2_PROTOCOL.
[in,out]HashOn input, points to a caller-allocated buffer of the size returned by GetHashSize() for the specified HashAlgorithm specified in preceding HashInit(). On output, the buffer holds the resulting hash computed from the message.
Return values
EFI_SUCCESSHash returned successfully.
EFI_INVALID_PARAMETERThis or Hash is NULL.
EFI_NOT_READYThis call was not preceded by a valid call to HashInit() and at least one call to HashUpdate(), or the operation in progress was canceled by a call to Hash() on the same instance.

Definition at line 175 of file Hash2.h.

◆ EFI_HASH2_HASH_INIT

typedef EFI_STATUS(EFIAPI * EFI_HASH2_HASH_INIT) (IN CONST EFI_HASH2_PROTOCOL *This, IN CONST EFI_GUID *HashAlgorithm)

This function must be called to initialize a digest calculation to be subsequently performed using the EFI_HASH2_PROTOCOL functions HashUpdate() and HashFinal().

Parameters
[in]ThisPoints to this instance of EFI_HASH2_PROTOCOL.
[in]HashAlgorithmPoints to the EFI_GUID which identifies the algorithm to use.
Return values
EFI_SUCCESSInitialized successfully.
EFI_INVALID_PARAMETERThis is NULL.
EFI_UNSUPPORTEDThe algorithm specified by HashAlgorithm is not supported by this driver or HashAlgorithm is Null.
EFI_OUT_OF_RESOURCESProcess failed due to lack of required resource.
EFI_ALREADY_STARTEDThis function is called when the operation in progress is still in processing Hash(), or HashInit() is already called before and not terminated by HashFinal() yet on the same instance.

Definition at line 129 of file Hash2.h.

◆ EFI_HASH2_HASH_UPDATE

typedef EFI_STATUS(EFIAPI * EFI_HASH2_HASH_UPDATE) (IN CONST EFI_HASH2_PROTOCOL *This, IN CONST UINT8 *Message, IN UINTN MessageSize)

Updates the hash of a computation in progress by adding a message text.

Parameters
[in]ThisPoints to this instance of EFI_HASH2_PROTOCOL.
[in]MessagePoints to the start of the message.
[in]MessageSizeThe size of Message, in bytes.
Return values
EFI_SUCCESSDigest in progress updated successfully.
EFI_INVALID_PARAMETERThis or Hash is NULL.
EFI_OUT_OF_RESOURCESSome resource required by the function is not available or MessageSize is greater than platform maximum.
EFI_NOT_READYThis call was not preceded by a valid call to HashInit(), or the operation in progress was terminated by a call to Hash() or HashFinal() on the same instance.

Definition at line 151 of file Hash2.h.

◆ EFI_HASH2_PROTOCOL

Definition at line 43 of file Hash2.h.

◆ EFI_MD5_HASH2

typedef UINT8 EFI_MD5_HASH2[16]

Definition at line 45 of file Hash2.h.

◆ EFI_SHA1_HASH2

typedef UINT8 EFI_SHA1_HASH2[20]

Definition at line 46 of file Hash2.h.

◆ EFI_SHA224_HASH2

typedef UINT8 EFI_SHA224_HASH2[28]

Definition at line 47 of file Hash2.h.

◆ EFI_SHA256_HASH2

typedef UINT8 EFI_SHA256_HASH2[32]

Definition at line 48 of file Hash2.h.

◆ EFI_SHA384_HASH2

typedef UINT8 EFI_SHA384_HASH2[48]

Definition at line 49 of file Hash2.h.

◆ EFI_SHA512_HASH2

typedef UINT8 EFI_SHA512_HASH2[64]

Definition at line 50 of file Hash2.h.