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