]> git.proxmox.com Git - mirror_edk2.git/blob - CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha256Null.c
CryptoPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / CryptoPkg / Library / BaseCryptLib / Hmac / CryptHmacSha256Null.c
1 /** @file
2 HMAC-SHA256 Wrapper Implementation which does not provide real capabilities.
3
4 Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 #include "InternalCryptLib.h"
10
11 /**
12 Retrieves the size, in bytes, of the context buffer required for HMAC-SHA256 operations.
13 (NOTE: This API is deprecated.
14 Use HmacSha256New() / HmacSha256Free() for HMAC-SHA256 Context operations.)
15
16 Return zero to indicate this interface is not supported.
17
18 @retval 0 This interface is not supported.
19
20 **/
21 UINTN
22 EFIAPI
23 HmacSha256GetContextSize (
24 VOID
25 )
26 {
27 ASSERT (FALSE);
28 return 0;
29 }
30
31 /**
32 Allocates and initializes one HMAC_CTX context for subsequent HMAC-SHA256 use.
33
34 Return NULL to indicate this interface is not supported.
35
36 @return NULL This interface is not supported..
37
38 **/
39 VOID *
40 EFIAPI
41 HmacSha256New (
42 VOID
43 )
44 {
45 ASSERT (FALSE);
46 return NULL;
47 }
48
49 /**
50 Release the specified HMAC_CTX context.
51
52 This function will do nothing.
53
54 @param[in] HmacSha256Ctx Pointer to the HMAC_CTX context to be released.
55
56 **/
57 VOID
58 EFIAPI
59 HmacSha256Free (
60 IN VOID *HmacSha256Ctx
61 )
62 {
63 ASSERT (FALSE);
64 return;
65 }
66
67 /**
68 Initializes user-supplied memory pointed by HmacSha256Context as HMAC-SHA256 context for
69 subsequent use.
70
71 Return FALSE to indicate this interface is not supported.
72
73 @param[out] HmacSha256Context Pointer to HMAC-SHA256 context being initialized.
74 @param[in] Key Pointer to the user-supplied key.
75 @param[in] KeySize Key size in bytes.
76
77 @retval FALSE This interface is not supported.
78
79 **/
80 BOOLEAN
81 EFIAPI
82 HmacSha256Init (
83 OUT VOID *HmacSha256Context,
84 IN CONST UINT8 *Key,
85 IN UINTN KeySize
86 )
87 {
88 ASSERT (FALSE);
89 return FALSE;
90 }
91
92 /**
93 Makes a copy of an existing HMAC-SHA256 context.
94
95 Return FALSE to indicate this interface is not supported.
96
97 @param[in] HmacSha256Context Pointer to HMAC-SHA256 context being copied.
98 @param[out] NewHmacSha256Context Pointer to new HMAC-SHA256 context.
99
100 @retval FALSE This interface is not supported.
101
102 **/
103 BOOLEAN
104 EFIAPI
105 HmacSha256Duplicate (
106 IN CONST VOID *HmacSha256Context,
107 OUT VOID *NewHmacSha256Context
108 )
109 {
110 ASSERT (FALSE);
111 return FALSE;
112 }
113
114 /**
115 Digests the input data and updates HMAC-SHA256 context.
116
117 Return FALSE to indicate this interface is not supported.
118
119 @param[in, out] HmacSha256Context Pointer to the HMAC-SHA256 context.
120 @param[in] Data Pointer to the buffer containing the data to be digested.
121 @param[in] DataSize Size of Data buffer in bytes.
122
123 @retval FALSE This interface is not supported.
124
125 **/
126 BOOLEAN
127 EFIAPI
128 HmacSha256Update (
129 IN OUT VOID *HmacSha256Context,
130 IN CONST VOID *Data,
131 IN UINTN DataSize
132 )
133 {
134 ASSERT (FALSE);
135 return FALSE;
136 }
137
138 /**
139 Completes computation of the HMAC-SHA256 digest value.
140
141 Return FALSE to indicate this interface is not supported.
142
143 @param[in, out] HmacSha256Context Pointer to the HMAC-SHA256 context.
144 @param[out] HmacValue Pointer to a buffer that receives the HMAC-SHA256 digest
145 value (32 bytes).
146
147 @retval FALSE This interface is not supported.
148
149 **/
150 BOOLEAN
151 EFIAPI
152 HmacSha256Final (
153 IN OUT VOID *HmacSha256Context,
154 OUT UINT8 *HmacValue
155 )
156 {
157 ASSERT (FALSE);
158 return FALSE;
159 }