]>
git.proxmox.com Git - mirror_edk2.git/blob - CryptoPkg/Library/BaseCryptLib/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"
12 Retrieves the size, in bytes, of the context buffer required for SHA-1 hash operations.
14 @return The size, in bytes, of the context buffer required for SHA-1 hash operations.
24 // Retrieves SHA Context Size
31 Initializes user-supplied memory pointed by Sha1Context as SHA-1 hash context for
34 If Sha1Context is NULL, then return FALSE.
36 @param[out] Sha1Context Pointer to SHA-1 context being initialized.
38 @retval TRUE SHA-1 context initialization succeeded.
39 @retval FALSE SHA-1 context initialization failed.
53 Makes a copy of an existing SHA-1 context.
55 If Sha1Context is NULL, then return FALSE.
56 If NewSha1Context is NULL, then return FALSE.
58 @param[in] Sha1Context Pointer to SHA-1 context being copied.
59 @param[out] NewSha1Context Pointer to new SHA-1 context.
61 @retval TRUE SHA-1 context copy succeeded.
62 @retval FALSE SHA-1 context copy failed.
68 IN CONST VOID
*Sha1Context
,
69 OUT VOID
*NewSha1Context
78 Digests the input data and updates SHA-1 context.
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.
85 If Sha1Context is NULL, then return FALSE.
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.
91 @retval TRUE SHA-1 data digest succeeded.
92 @retval FALSE SHA-1 data digest failed.
98 IN OUT VOID
*Sha1Context
,
108 Completes computation of the SHA-1 digest value.
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
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.
116 If Sha1Context is NULL, then return FALSE.
117 If HashValue is NULL, then return FALSE.
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
123 @retval TRUE SHA-1 digest computation succeeded.
124 @retval FALSE SHA-1 digest computation failed.
130 IN OUT VOID
*Sha1Context
,
139 Computes the SHA-1 message digest of a input data buffer.
141 This function performs the SHA-1 message digest of a given data buffer, and places
142 the digest value into the specified memory.
144 If this interface is not supported, then return FALSE.
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
151 @retval TRUE SHA-1 digest computation succeeded.
152 @retval FALSE SHA-1 digest computation failed.
153 @retval FALSE This interface is not supported.