LIBKECCAK_CSHAKE_INITIALISE(3)

πŸ“¦ version 1.4.3, in arch rolling, opensuse-leap 16.0

Hey bestie, welcome to LIBKECCAK_..._INITIALISE(3) from the Library Functions Manual ✨ this one's all about getting your cSHAKE sponge ready to slay.

πŸ’– 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 🧚

Okay so, plot twist: the DESCRIPTION says 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. I'm just relaying the lore, bestie πŸ’…

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

  • n_text β€” 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.
  • 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.
  • 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. No return value, periodt πŸ’–

🌈 ERRORS 🌈

The libkeccak_cshake_suffix() function cannot fail. It's giving flawless, honestly ✨

πŸ‘‘ SEE ALSO πŸ‘‘


xoxo, signing off from the LIBKECCAK manual πŸ’– page LIBKECCAK_..._INITIALISE(3) β€” no date in the footer, so we're keeping it mysterious πŸŽ€

πŸ“¦ where this page comes from