Scroll to navigation

LIBKECCAK_CSHAKE_INITIALISE(3) Library Functions Manual LIBKECCAK_CSHAKE_INITIALISE(3)

NAME

libkeccak_cshake_initialise - Initialise a sponge for cSHAKE hashing

SYNOPSIS

#include <libkeccak.h>
void libkeccak_cshake_initialise(struct libkeccak_state *restrict state,

const void *n_text, size_t n_len, size_t n_bits, const char *n_suffix,
const void *s_text, size_t s_len, size_t s_bits, const char *s_suffix);

Link with -lkeccak.

DESCRIPTION

The libkeccak_cshake_suffix() function shall be called immediately after the libkeccak_state_initialise(3) function (before libkeccak_update(3) or libkeccak_digest(3), or any variant of those functions), to provide the initialisation blocks, containing customisation data, to the Keccak sponge.

The value of the state parameter shall be an initialised state to feed the initialisation blocks to.

The value of the n_text parameter shall be the function-name bit-string, represented in raw bytes; n_len shall be value no greater than the number of whole bytes in n_text and n_bits shall be the number of bits in n_text sans the bytes covered by n_len, that is, the number of bits in n_text minus (nlen_*8). n_suffix shall be either NULL or an appendix of bits to n_suffix (neither n_len nor n_bits shall count these), stored as a NUL-terminated string of the ASCII digits 1 and 0.

The value of the s_text parameter shall be the customisation bit-string, represented in raw bytes; s_len shall be value no greater than the number of whole bytes in s_text and s_bits shall be the number of bits in s_text sans the bytes covered by s_len, that is, the number of bits in s_text minus (nles_*8). s_suffix shall be either NULL or an appendix of bits to s_suffix (neither s_len nor s_bits shall count these), stored as a NUL-terminated string of the ASCII digits 1 and 0.

For the n_suffix and s_suffix parameters, NULL is treated as the empty string.

RETURN VALUES

The libkeccak_cshake_suffix() function does not return a value.

ERRORS

The libkeccak_cshake_suffix() function cannot fail.

SEE ALSO

libkeccak_spec_cshake(3), libkeccak_generalised_spec_initialise(3), libkeccak_state_initialise(3), libkeccak_cshake_initialise(3), libkeccak_fast_update(3), libkeccak_zerocopy_update(3), libkeccak_update(3), libkeccak_fast_digest(3), libkeccak_zerocopy_digest(3), libkeccak_digest(3)

LIBKECCAK