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