Extendable output functions
Single-part example
#define MESSAGE ((const unsigned char *) "Arbitrary data to hash")
#define MESSAGE_LEN 22
unsigned char out[32];
crypto_xof_turboshake128(out, sizeof out, MESSAGE, MESSAGE_LEN);Multi-part example
#define MESSAGE_PART1 \
((const unsigned char *) "Arbitrary data to hash")
#define MESSAGE_PART1_LEN 22
#define MESSAGE_PART2 \
((const unsigned char *) "is longer than expected")
#define MESSAGE_PART2_LEN 23
unsigned char out[32];
crypto_xof_turboshake128_state state;
crypto_xof_turboshake128_init(&state);
crypto_xof_turboshake128_update(&state, MESSAGE_PART1, MESSAGE_PART1_LEN);
crypto_xof_turboshake128_update(&state, MESSAGE_PART2, MESSAGE_PART2_LEN);
crypto_xof_turboshake128_squeeze(&state, out, sizeof out);Incremental output
Purpose
Real-world use cases
Deriving multiple keys from a master secret
Generating deterministic test vectors
Hashing with context/domain separation
Hash-to-curve or hash-to-field
Replacing HKDF-Expand
SHAKE
Single-part API
Multi-part API
Custom domain separation
Constants
Data types
TurboSHAKE
Single-part API
Multi-part API
Custom domain separation
Constants
Data types
Which variant to use
Algorithm details
Function
Security
Block size
Rounds
Notes
Last updated