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