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