www.LinuxHowtos.org
SHAKE
Section: C Library Functions (3)Index Return to Main Contents
BSD mandoc
NAME
SHAKE - NIST FIPS PUB 202: SH-3 Standard: Permutatio-Based Hash and Extendabl-Output FunctionsLIBRARY
Lb libmdSYNOPSIS
In sha3.h Ft void Fn SHAKE128_Init SHAKE128_CTX *ctx Ft void Fn SHAKE128_Update SHAKE128_CTX *ctx const uint8_t *buf size_t len Ft void Fn SHAKE128_Final uint8_t *output[] size_t outlen SHAKE128_CTX *ctx Ft void Fn SHAKE256_Init SHAKE256_CTX *ctx Ft void Fn SHAKE256_Update SHAKE256_CTX *ctx const uint8_t *buf size_t len Ft void Fn SHAKE256_Final uint8_t *output[] size_t outlen SHAKE256_CTX *ctxDESCRIPTION
The functions implement the extendabl-output functions of the NIST SH-3 standard, FIPS PUB 202. The functions absorb an arbitrar-length message m and yield an arbitrar-length output SHAKE128(m) or SHAKE256(m), truncated to a specified number of octets.Before using the functions, applications should first call SHA3_Selftest3 and confirm that it succeeded.
Only the SHAKE128 functions are specified in detail; the SHAKE256 functions are analogous.
The caller must allocate memory for a Vt SHAKE128_CTX object to hold the state of a SHAKE128 computation over a message. Vt SHAKE128_CTX objects may be copied or relocated in memory.
- Fn SHAKE128_Init ctx
- Initialize a SHAKE128 context. Must be done before any other operations on Fa ctx .
- Fn SHAKE128_Update ctx data len
- Append Fa len octets at Fa data to the message.
- Fn SHAKE128_Final output outlen ctx
-
Store at
Fa output
the first
Fa outlen
octets of the SHAKE128 output for the message obtained by concatenating
all prior inputs to
Fn SHAKE128_Update
on
Fa ctx .
Subsequent use of Fa ctx is not allowed, unless it is reinitialized with Fn SHAKE128_Init .
SEE ALSO
sha3(3), SHA3_Selftest3STANDARDS
- 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