VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Include/Library/HashApiLib.h@ 89753

Last change on this file since 89753 was 85718, checked in by vboxsync, 5 years ago

Devices/EFI: Merge edk-stable202005 and make it build, bugref:4643

  • Property svn:eol-style set to native
File size: 2.3 KB
Line 
1/** @file
2 Unified Hash API Defines
3
4 This API when called will calculate the Hash using the
5 hashing algorithm specified by PcdHashApiLibPolicy.
6
7 Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
8 SPDX-License-Identifier: BSD-2-Clause-Patent
9
10**/
11
12#ifndef __HASH_API_LIB_H_
13#define __HASH_API_LIB_H_
14
15typedef VOID *HASH_API_CONTEXT;
16
17/**
18 Retrieves the size, in bytes, of the context buffer required for hash operations.
19
20 @return The size, in bytes, of the context buffer required for hash operations.
21**/
22UINTN
23EFIAPI
24HashApiGetContextSize (
25 VOID
26 );
27
28/**
29 Init hash sequence.
30
31 @param[out] HashContext Hash context.
32
33 @retval TRUE Hash start and HashHandle returned.
34 @retval FALSE Hash Init unsuccessful.
35**/
36BOOLEAN
37EFIAPI
38HashApiInit (
39 OUT HASH_API_CONTEXT HashContext
40 );
41
42/**
43 Makes a copy of an existing hash context.
44
45 @param[in] HashContext Hash context.
46 @param[out] NewHashContext New copy of hash context.
47
48 @retval TRUE Hash context copy succeeded.
49 @retval FALSE Hash context copy failed.
50**/
51BOOLEAN
52EFIAPI
53HashApiDuplicate (
54 IN HASH_API_CONTEXT HashContext,
55 OUT HASH_API_CONTEXT NewHashContext
56 );
57
58/**
59 Update hash data.
60
61 @param[in] HashContext Hash context.
62 @param[in] DataToHash Data to be hashed.
63 @param[in] DataToHashLen Data size.
64
65 @retval TRUE Hash updated.
66 @retval FALSE Hash updated unsuccessful.
67**/
68BOOLEAN
69EFIAPI
70HashApiUpdate (
71 IN HASH_API_CONTEXT HashContext,
72 IN VOID *DataToHash,
73 IN UINTN DataToHashLen
74 );
75
76/**
77 Hash complete.
78
79 @param[in] HashContext Hash context.
80 @param[out] Digest Hash Digest.
81
82 @retval TRUE Hash complete and Digest is returned.
83 @retval FALSE Hash complete unsuccessful.
84**/
85BOOLEAN
86EFIAPI
87HashApiFinal (
88 IN HASH_API_CONTEXT HashContext,
89 OUT UINT8 *Digest
90 );
91
92/**
93 Computes hash message digest of a input data buffer.
94
95 @param[in] DataToHash Data to be hashed.
96 @param[in] DataToHashLen Data size.
97 @param[out] Digest Hash Digest.
98
99 @retval TRUE Hash digest computation succeeded.
100 @retval FALSE Hash digest computation failed.
101**/
102BOOLEAN
103EFIAPI
104HashApiHashAll (
105 IN CONST VOID *DataToHash,
106 IN UINTN DataToHashLen,
107 OUT UINT8 *Digest
108 );
109
110#endif
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette