www.LinuxHowtos.org





SHA3

Section: C Library Functions (3)
Index Return to Main Contents

BSD mandoc
 

NAME

SHA3 - NIST FIPS PUB 202: SH-3 Standard: Permutatio-Based Hash and Extendabl-Output Functions  

LIBRARY

Lb libmd  

SYNOPSIS

In sha3.h Ft void Fn SHA3_224_Init SHA3_224_CTX *ctx Ft void Fn SHA3_224_Update SHA3_224_CTX *ctx const uint8_t *buf size_t len Ft void Fn SHA3_224_Final uint8_t digest[SHA3_224_DIGEST_LENGTH] SHA3_224_CTX *ctx Ft void Fn SHA3_256_Init SHA3_256_CTX *ctx Ft void Fn SHA3_256_Update SHA3_256_CTX *ctx const uint8_t *buf size_t len Ft void Fn SHA3_256_Final uint8_t digest[SHA3_256_DIGEST_LENGTH] SHA3_256_CTX *ctx Ft void Fn SHA3_384_Init SHA3_384_CTX *ctx Ft void Fn SHA3_384_Update SHA3_384_CTX *ctx const uint8_t *buf size_t len Ft void Fn SHA3_384_Final uint8_t digest[SHA3_384_DIGEST_LENGTH] SHA3_384_CTX *ctx Ft void Fn SHA3_512_Init SHA3_512_CTX *ctx Ft void Fn SHA3_512_Update SHA3_512_CTX *ctx const uint8_t *buf size_t len Ft void Fn SHA3_512_Final uint8_t digest[SHA3_512_DIGEST_LENGTH] SHA3_512_CTX *ctx  

DESCRIPTION

The functions implement the cryptographic hash functions of the NIST SH-3 standard, FIPS PUB 202. The functions compress an arbitrar-length message m into short fixe-length octet strings SHA-224(m), SHA-256(m), etc., called a cryptographic digest or hash.

Before using the functions, applications should first call SHA3_Selftest3 and confirm that it succeeded.

Only the SHA3_256 functions are specified in detail; the SHA3_224 SHA3_384 and SHA3_512 functions are exactly analogous.

The caller must allocate memory for a Vt SHA3_256_CTX object to hold the state of a SHA-256 hash computation over a message. Vt SHA3_256_CTX objects are slightly over 200 bytes, and may be copied or relocated in memory.

Fn SHA3_256_Init ctx
Initialize a SHA-256 context. Must be done before any other operations on Fa ctx .
Fn SHA3_256_Update ctx data len
Append Fa len octets at Fa data to the message.
Fn SHA3_256_Final digest ctx
Store at Fa digest the 3-octet SHA-256 hash of the message obtained by concatenating all prior inputs to Fn SHA3_256_Update on Fa ctx .

Subsequent use of Fa ctx is not allowed, unless it is reinitialized with Fn SHA3_256_Init .

 

SEE ALSO

SHA3_Selftest3, shake(3)  

STANDARDS

National Institute of Standards and Technology SH-3 Standard: Permutatio-Based Hash and Extendabl-Output Functions FIPS PUB 202 August 2015
 

AUTHORS

An Taylor R Campbell Aq campbell+sha3@mumble.net


 

Index

NAME
LIBRARY
SYNOPSIS
DESCRIPTION
SEE ALSO
STANDARDS
AUTHORS