TianoCore EDK2 master
Loading...
Searching...
No Matches
CryptSha3.c File Reference

Go to the source code of this file.

Functions

UINT8 EFIAPI KeccakInit (OUT Keccak1600_Ctx *Context, IN UINT8 Pad, IN UINTN BlockSize, IN UINTN MessageDigestLen)
 
UINT8 EFIAPI Sha3Update (IN OUT Keccak1600_Ctx *Context, IN const VOID *Data, IN UINTN DataSize)
 
UINT8 EFIAPI Sha3Final (IN OUT Keccak1600_Ctx *Context, OUT UINT8 *MessageDigest)
 

Detailed Description

SHA3 realted functions from OpenSSL.

Copyright (c) 2022, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Copyright 2022 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at https://www.openssl.org/source/license.html

Definition in file CryptSha3.c.

Function Documentation

◆ KeccakInit()

UINT8 EFIAPI KeccakInit ( OUT Keccak1600_Ctx Context,
IN UINT8  Pad,
IN UINTN  BlockSize,
IN UINTN  MessageDigestLen 
)

Keccak initial fuction.

Set up state with specified capacity.

Parameters
[out]ContextPointer to the context being initialized.
[in]PadDelimited Suffix.
[in]BlockSizeSize of context block.
[in]MessageDigestLenSize of message digest in bytes.
Return values
1Initialize successfully.
0Fail to initialize.

Definition at line 31 of file CryptSha3.c.

◆ Sha3Final()

UINT8 EFIAPI Sha3Final ( IN OUT Keccak1600_Ctx Context,
OUT UINT8 *  MessageDigest 
)

Completes computation of Sha3 message digest.

This function completes sha3 hash computation and retrieves the digest value into the specified memory. After this function has been called, the keccak context cannot be used again.

Parameters
[in,out]ContextPointer to the keccak context.
[out]MessageDigestPointer to a buffer that receives the message digest.
Return values
1Meaasge digest computation succeeded.

Definition at line 137 of file CryptSha3.c.

◆ Sha3Update()

UINT8 EFIAPI Sha3Update ( IN OUT Keccak1600_Ctx Context,
IN const VOID *  Data,
IN UINTN  DataSize 
)

Sha3 update fuction.

This function performs Sha3 digest on a data buffer of the specified size. It can be called multiple times to compute the digest of long or discontinuous data streams.

Parameters
[in,out]ContextPointer to the Keccak context.
[in]DataPointer to the buffer containing the data to be hashed.
[in]DataSizeSize of Data buffer in bytes.
Return values
1Update successfully.

Definition at line 66 of file CryptSha3.c.