shake - Man Page
NIST FIPS PUB 202: SHA-3 Standard: Permutation-Based Hash and Extendable-Output Functions
Library
Message Digest (MD4, MD5, etc.) Support Library (libmd, -lmd)
Synopsis
#include <sha3.h>
void
SHAKE128_Init(SHAKE128_CTX *ctx);
void
SHAKE128_Update(SHAKE128_CTX *ctx, const uint8_t *buf, size_t len);
void
SHAKE128_Final(uint8_t *output[], size_t outlen, SHAKE128_CTX *ctx);
void
SHAKE256_Init(SHAKE256_CTX *ctx);
void
SHAKE256_Update(SHAKE256_CTX *ctx, const uint8_t *buf, size_t len);
void
SHAKE256_Final(uint8_t *output[], size_t outlen, SHAKE256_CTX *ctx);
Description
The SHAKE functions implement the extendable-output functions of the NIST SHA-3 standard, FIPS PUB 202. The SHAKE functions absorb an arbitrary-length message m and yield an arbitrary-length output SHAKE128(m) or SHAKE256(m), truncated to a specified number of octets.
Before using the SHAKE functions, applications should first call SHA3_Selftest(3) 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 SHAKE128_CTX object to hold the state of a SHAKE128 computation over a message. SHAKE128_CTX objects may be copied or relocated in memory.
- SHAKE128_Init(ctx)
Initialize a SHAKE128 context. Must be done before any other operations on ctx.
- SHAKE128_Update(ctx, data, len)
Append len octets at data to the message.
- SHAKE128_Final(output, outlen, ctx)
Store at output the first outlen octets of the SHAKE128 output for the message obtained by concatenating all prior inputs to
SHAKE128_Update() on ctx.Subsequent use of ctx is not allowed, unless it is reinitialized with
SHAKE128_Init().
See Also
Standards
National Institute of Standards and Technology, SHA-3 Standard: Permutation-Based Hash and Extendable-Output Functions, August 2015, FIPS PUB 202.
Authors
Taylor R Campbell ⟨campbell+sha3@mumble.net⟩
Referenced By
The man pages SHAKE128_Final(3), SHAKE128_Init(3), SHAKE128_Update(3), SHAKE256_Final(3), SHAKE256_Init(3) and SHAKE256_Update(3) are aliases of shake(3).