]>
Commit | Line | Data |
---|---|---|
b1567b2e MX |
1 | /** @file\r |
2 | SM3 Digest Wrapper Null Implementation.\r | |
3 | \r | |
4 | Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>\r | |
5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r | |
6 | \r | |
7 | **/\r | |
8 | \r | |
9 | #include "InternalCryptLib.h"\r | |
10 | \r | |
11 | /**\r | |
12 | Retrieves the size, in bytes, of the context buffer required for SM3 hash operations.\r | |
13 | \r | |
14 | @return The size, in bytes, of the context buffer required for SM3 hash operations.\r | |
15 | \r | |
16 | **/\r | |
17 | UINTN\r | |
18 | EFIAPI\r | |
19 | Sm3GetContextSize (\r | |
20 | VOID\r | |
21 | )\r | |
22 | {\r | |
23 | ASSERT (FALSE);\r | |
24 | return 0;\r | |
25 | }\r | |
26 | \r | |
27 | /**\r | |
28 | Initializes user-supplied memory pointed by Sm3Context as SM3 hash context for\r | |
29 | subsequent use.\r | |
30 | \r | |
31 | If Sm3Context is NULL, then return FALSE.\r | |
32 | \r | |
33 | @param[out] Sm3Context Pointer to SM3 context being initialized.\r | |
34 | \r | |
35 | @retval TRUE SM3 context initialization succeeded.\r | |
36 | @retval FALSE SM3 context initialization failed.\r | |
37 | \r | |
38 | **/\r | |
39 | BOOLEAN\r | |
40 | EFIAPI\r | |
41 | Sm3Init (\r | |
42 | OUT VOID *Sm3Context\r | |
43 | )\r | |
44 | {\r | |
45 | ASSERT (FALSE);\r | |
46 | return FALSE;\r | |
47 | }\r | |
48 | \r | |
49 | /**\r | |
50 | Makes a copy of an existing SM3 context.\r | |
51 | \r | |
52 | If Sm3Context is NULL, then return FALSE.\r | |
53 | If NewSm3Context is NULL, then return FALSE.\r | |
54 | If this interface is not supported, then return FALSE.\r | |
55 | \r | |
56 | @param[in] Sm3Context Pointer to SM3 context being copied.\r | |
57 | @param[out] NewSm3Context Pointer to new SM3 context.\r | |
58 | \r | |
59 | @retval TRUE SM3 context copy succeeded.\r | |
60 | @retval FALSE SM3 context copy failed.\r | |
61 | @retval FALSE This interface is not supported.\r | |
62 | \r | |
63 | **/\r | |
64 | BOOLEAN\r | |
65 | EFIAPI\r | |
66 | Sm3Duplicate (\r | |
67 | IN CONST VOID *Sm3Context,\r | |
68 | OUT VOID *NewSm3Context\r | |
69 | )\r | |
70 | {\r | |
71 | ASSERT (FALSE);\r | |
72 | return FALSE;\r | |
73 | }\r | |
74 | \r | |
75 | /**\r | |
76 | Digests the input data and updates SM3 context.\r | |
77 | \r | |
78 | This function performs SM3 digest on a data buffer of the specified size.\r | |
79 | It can be called multiple times to compute the digest of long or discontinuous data streams.\r | |
80 | SM3 context should be already correctly initialized by Sm3Init(), and should not be finalized\r | |
81 | by Sm3Final(). Behavior with invalid context is undefined.\r | |
82 | \r | |
83 | If Sm3Context is NULL, then return FALSE.\r | |
84 | \r | |
85 | @param[in, out] Sm3Context Pointer to the SM3 context.\r | |
86 | @param[in] Data Pointer to the buffer containing the data to be hashed.\r | |
87 | @param[in] DataSize Size of Data buffer in bytes.\r | |
88 | \r | |
89 | @retval TRUE SM3 data digest succeeded.\r | |
90 | @retval FALSE SM3 data digest failed.\r | |
91 | \r | |
92 | **/\r | |
93 | BOOLEAN\r | |
94 | EFIAPI\r | |
95 | Sm3Update (\r | |
96 | IN OUT VOID *Sm3Context,\r | |
97 | IN CONST VOID *Data,\r | |
98 | IN UINTN DataSize\r | |
99 | )\r | |
100 | {\r | |
101 | ASSERT (FALSE);\r | |
102 | return FALSE;\r | |
103 | }\r | |
104 | \r | |
105 | /**\r | |
106 | Completes computation of the SM3 digest value.\r | |
107 | \r | |
108 | This function completes SM3 hash computation and retrieves the digest value into\r | |
109 | the specified memory. After this function has been called, the SM3 context cannot\r | |
110 | be used again.\r | |
111 | SM3 context should be already correctly initialized by Sm3Init(), and should not be\r | |
112 | finalized by Sm3Final(). Behavior with invalid SM3 context is undefined.\r | |
113 | \r | |
114 | If Sm3Context is NULL, then return FALSE.\r | |
115 | If HashValue is NULL, then return FALSE.\r | |
116 | \r | |
117 | @param[in, out] Sm3Context Pointer to the SM3 context.\r | |
118 | @param[out] HashValue Pointer to a buffer that receives the SM3 digest\r | |
119 | value (32 bytes).\r | |
120 | \r | |
121 | @retval TRUE SM3 digest computation succeeded.\r | |
122 | @retval FALSE SM3 digest computation failed.\r | |
123 | \r | |
124 | **/\r | |
125 | BOOLEAN\r | |
126 | EFIAPI\r | |
127 | Sm3Final (\r | |
128 | IN OUT VOID *Sm3Context,\r | |
129 | OUT UINT8 *HashValue\r | |
130 | )\r | |
131 | {\r | |
132 | ASSERT (FALSE);\r | |
133 | return FALSE;\r | |
134 | }\r | |
135 | \r | |
136 | /**\r | |
137 | Computes the SM3 message digest of a input data buffer.\r | |
138 | \r | |
139 | This function performs the SM3 message digest of a given data buffer, and places\r | |
140 | the digest value into the specified memory.\r | |
141 | \r | |
142 | If this interface is not supported, then return FALSE.\r | |
143 | \r | |
144 | @param[in] Data Pointer to the buffer containing the data to be hashed.\r | |
145 | @param[in] DataSize Size of Data buffer in bytes.\r | |
146 | @param[out] HashValue Pointer to a buffer that receives the SM3 digest\r | |
147 | value (32 bytes).\r | |
148 | \r | |
149 | @retval TRUE SM3 digest computation succeeded.\r | |
150 | @retval FALSE SM3 digest computation failed.\r | |
151 | @retval FALSE This interface is not supported.\r | |
152 | \r | |
153 | **/\r | |
154 | BOOLEAN\r | |
155 | EFIAPI\r | |
156 | Sm3HashAll (\r | |
157 | IN CONST VOID *Data,\r | |
158 | IN UINTN DataSize,\r | |
159 | OUT UINT8 *HashValue\r | |
160 | )\r | |
161 | {\r | |
162 | ASSERT (FALSE);\r | |
163 | return FALSE;\r | |
164 | }\r |