]> git.proxmox.com Git - mirror_edk2.git/blob - CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha256Null.c
1696fa1eb919cc553cdacfd98fd25a96b980a802
[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 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #include "InternalCryptLib.h"
16
17 /**
18 Retrieves the size, in bytes, of the context buffer required for HMAC-SHA256 operations.
19 (NOTE: This API is deprecated.
20 Use HmacSha256New() / HmacSha256Free() for HMAC-SHA256 Context operations.)
21
22 Return zero to indicate this interface is not supported.
23
24 @retval 0 This interface is not supported.
25
26 **/
27 UINTN
28 EFIAPI
29 HmacSha256GetContextSize (
30 VOID
31 )
32 {
33 ASSERT (FALSE);
34 return 0;
35 }
36
37 /**
38 Allocates and initializes one HMAC_CTX context for subsequent HMAC-SHA256 use.
39
40 Return NULL to indicate this interface is not supported.
41
42 @return NULL This interface is not supported..
43
44 **/
45 VOID *
46 EFIAPI
47 HmacSha256New (
48 VOID
49 )
50 {
51 ASSERT (FALSE);
52 return NULL;
53 }
54
55 /**
56 Release the specified HMAC_CTX context.
57
58 This function will do nothing.
59
60 @param[in] HmacSha256Ctx Pointer to the HMAC_CTX context to be released.
61
62 **/
63 VOID
64 EFIAPI
65 HmacSha256Free (
66 IN VOID *HmacSha256Ctx
67 )
68 {
69 ASSERT (FALSE);
70 return;
71 }
72
73 /**
74 Initializes user-supplied memory pointed by HmacSha256Context as HMAC-SHA256 context for
75 subsequent use.
76
77 Return FALSE to indicate this interface is not supported.
78
79 @param[out] HmacSha256Context Pointer to HMAC-SHA256 context being initialized.
80 @param[in] Key Pointer to the user-supplied key.
81 @param[in] KeySize Key size in bytes.
82
83 @retval FALSE This interface is not supported.
84
85 **/
86 BOOLEAN
87 EFIAPI
88 HmacSha256Init (
89 OUT VOID *HmacSha256Context,
90 IN CONST UINT8 *Key,
91 IN UINTN KeySize
92 )
93 {
94 ASSERT (FALSE);
95 return FALSE;
96 }
97
98 /**
99 Makes a copy of an existing HMAC-SHA256 context.
100
101 Return FALSE to indicate this interface is not supported.
102
103 @param[in] HmacSha256Context Pointer to HMAC-SHA256 context being copied.
104 @param[out] NewHmacSha256Context Pointer to new HMAC-SHA256 context.
105
106 @retval FALSE This interface is not supported.
107
108 **/
109 BOOLEAN
110 EFIAPI
111 HmacSha256Duplicate (
112 IN CONST VOID *HmacSha256Context,
113 OUT VOID *NewHmacSha256Context
114 )
115 {
116 ASSERT (FALSE);
117 return FALSE;
118 }
119
120 /**
121 Digests the input data and updates HMAC-SHA256 context.
122
123 Return FALSE to indicate this interface is not supported.
124
125 @param[in, out] HmacSha256Context Pointer to the HMAC-SHA256 context.
126 @param[in] Data Pointer to the buffer containing the data to be digested.
127 @param[in] DataSize Size of Data buffer in bytes.
128
129 @retval FALSE This interface is not supported.
130
131 **/
132 BOOLEAN
133 EFIAPI
134 HmacSha256Update (
135 IN OUT VOID *HmacSha256Context,
136 IN CONST VOID *Data,
137 IN UINTN DataSize
138 )
139 {
140 ASSERT (FALSE);
141 return FALSE;
142 }
143
144 /**
145 Completes computation of the HMAC-SHA256 digest value.
146
147 Return FALSE to indicate this interface is not supported.
148
149 @param[in, out] HmacSha256Context Pointer to the HMAC-SHA256 context.
150 @param[out] HmacValue Pointer to a buffer that receives the HMAC-SHA256 digest
151 value (32 bytes).
152
153 @retval FALSE This interface is not supported.
154
155 **/
156 BOOLEAN
157 EFIAPI
158 HmacSha256Final (
159 IN OUT VOID *HmacSha256Context,
160 OUT UINT8 *HmacValue
161 )
162 {
163 ASSERT (FALSE);
164 return FALSE;
165 }