CryptoPkg: Update HMAC Wrapper with opaque HMAC_CTX object.
[mirror_edk2.git] / CryptoPkg / Library / BaseCryptLib / Hmac / CryptHmacSha1Null.c
1 /** @file
2 HMAC-SHA1 Wrapper Implementation which does not provide real capabilities.
3
4 Copyright (c) 2012 - 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-SHA1 operations.
19 (NOTE: This API is deprecated.
20 Use HmacSha1New() / HmacSha1Free() for HMAC-SHA1 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 HmacSha1GetContextSize (
30 VOID
31 )
32 {
33 ASSERT (FALSE);
34 return 0;
35 }
36
37 /**
38 Allocates and initializes one HMAC_CTX context for subsequent HMAC-SHA1 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 HmacSha1New (
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] HmacSha1Ctx Pointer to the HMAC_CTX context to be released.
61
62 **/
63 VOID
64 EFIAPI
65 HmacSha1Free (
66 IN VOID *HmacSha1Ctx
67 )
68 {
69 ASSERT (FALSE);
70 return;
71 }
72
73 /**
74 Initializes user-supplied memory pointed by HmacSha1Context as HMAC-SHA1 context for
75 subsequent use.
76
77 Return FALSE to indicate this interface is not supported.
78
79 @param[out] HmacSha1Context Pointer to HMAC-SHA1 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 HmacSha1Init (
89 OUT VOID *HmacSha1Context,
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-SHA1 context.
100
101 Return FALSE to indicate this interface is not supported.
102
103 @param[in] HmacSha1Context Pointer to HMAC-SHA1 context being copied.
104 @param[out] NewHmacSha1Context Pointer to new HMAC-SHA1 context.
105
106 @retval FALSE This interface is not supported.
107
108 **/
109 BOOLEAN
110 EFIAPI
111 HmacSha1Duplicate (
112 IN CONST VOID *HmacSha1Context,
113 OUT VOID *NewHmacSha1Context
114 )
115 {
116 ASSERT (FALSE);
117 return FALSE;
118 }
119
120 /**
121 Digests the input data and updates HMAC-SHA1 context.
122
123 Return FALSE to indicate this interface is not supported.
124
125 @param[in, out] HmacSha1Context Pointer to the HMAC-SHA1 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 HmacSha1Update (
135 IN OUT VOID *HmacSha1Context,
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-SHA1 digest value.
146
147 Return FALSE to indicate this interface is not supported.
148
149 @param[in, out] HmacSha1Context Pointer to the HMAC-SHA1 context.
150 @param[out] HmacValue Pointer to a buffer that receives the HMAC-SHA1 digest
151 value (20 bytes).
152
153 @retval FALSE This interface is not supported.
154
155 **/
156 BOOLEAN
157 EFIAPI
158 HmacSha1Final (
159 IN OUT VOID *HmacSha1Context,
160 OUT UINT8 *HmacValue
161 )
162 {
163 ASSERT (FALSE);
164 return FALSE;
165 }