]>
git.proxmox.com Git - mirror_edk2.git/blob - CryptoPkg/Library/BaseCryptLibNull/Hash/CryptSha1Null.c
2 SHA-1 Digest Wrapper Null Implementation.
4 Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #include "InternalCryptLib.h"
13 Retrieves the size, in bytes, of the context buffer required for SHA-1 hash operations.
15 @return The size, in bytes, of the context buffer required for SHA-1 hash operations.
25 // Retrieves SHA Context Size
32 Initializes user-supplied memory pointed by Sha1Context as SHA-1 hash context for
35 If Sha1Context is NULL, then return FALSE.
37 @param[out] Sha1Context Pointer to SHA-1 context being initialized.
39 @retval TRUE SHA-1 context initialization succeeded.
40 @retval FALSE SHA-1 context initialization failed.
54 Makes a copy of an existing SHA-1 context.
56 If Sha1Context is NULL, then return FALSE.
57 If NewSha1Context is NULL, then return FALSE.
59 @param[in] Sha1Context Pointer to SHA-1 context being copied.
60 @param[out] NewSha1Context Pointer to new SHA-1 context.
62 @retval TRUE SHA-1 context copy succeeded.
63 @retval FALSE SHA-1 context copy failed.
69 IN CONST VOID
*Sha1Context
,
70 OUT VOID
*NewSha1Context
79 Digests the input data and updates SHA-1 context.
81 This function performs SHA-1 digest on a data buffer of the specified size.
82 It can be called multiple times to compute the digest of long or discontinuous data streams.
83 SHA-1 context should be already correctly initialized by Sha1Init(), and should not be finalized
84 by Sha1Final(). Behavior with invalid context is undefined.
86 If Sha1Context is NULL, then return FALSE.
88 @param[in, out] Sha1Context Pointer to the SHA-1 context.
89 @param[in] Data Pointer to the buffer containing the data to be hashed.
90 @param[in] DataSize Size of Data buffer in bytes.
92 @retval TRUE SHA-1 data digest succeeded.
93 @retval FALSE SHA-1 data digest failed.
99 IN OUT VOID
*Sha1Context
,
109 Completes computation of the SHA-1 digest value.
111 This function completes SHA-1 hash computation and retrieves the digest value into
112 the specified memory. After this function has been called, the SHA-1 context cannot
114 SHA-1 context should be already correctly initialized by Sha1Init(), and should not be
115 finalized by Sha1Final(). Behavior with invalid SHA-1 context is undefined.
117 If Sha1Context is NULL, then return FALSE.
118 If HashValue is NULL, then return FALSE.
120 @param[in, out] Sha1Context Pointer to the SHA-1 context.
121 @param[out] HashValue Pointer to a buffer that receives the SHA-1 digest
124 @retval TRUE SHA-1 digest computation succeeded.
125 @retval FALSE SHA-1 digest computation failed.
131 IN OUT VOID
*Sha1Context
,
140 Computes the SHA-1 message digest of a input data buffer.
142 This function performs the SHA-1 message digest of a given data buffer, and places
143 the digest value into the specified memory.
145 If this interface is not supported, then return FALSE.
147 @param[in] Data Pointer to the buffer containing the data to be hashed.
148 @param[in] DataSize Size of Data buffer in bytes.
149 @param[out] HashValue Pointer to a buffer that receives the SHA-1 digest
152 @retval TRUE SHA-1 digest computation succeeded.
153 @retval FALSE SHA-1 digest computation failed.
154 @retval FALSE This interface is not supported.