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