LIBKECCAK_STATE_DUPLICATE(3)

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

🌸 NAME 🌸

Okay bestie, this is the LIBKECCAK_STATE_DUPLICATE(3) page from the Library Functions Manual, and it is literally about one thing: allocating a duplicate hash state. Slay. πŸ’…

πŸ¦‹ SYNOPSIS πŸ¦‹

#include <libkeccak.h>

struct libkeccak_state *libkeccak_state_duplicate(const struct libkeccak_state *src);

Link with -lkeccakP.

✨ DESCRIPTION ✨

So libkeccak_state_duplicate() allocates a new hash state and initialises it to be identical to *src. Not similar, not "close enough" β€” identical identical, bestie 🫢.

That means all members of the struct libkeccak_state structure get duplicated, including the state of the sponge and the message chunk buffer. The way it copies the whole struct is highkey main character energy πŸ‘‘.

πŸŽ€ RETURN VALUES πŸŽ€

On successful completion, libkeccak_state_duplicate() returns a newly allocated struct libkeccak_state* (of one initialised element). Iconic, no notes. ✨

On error, NULL is returned and errno is set to describe the error. Sad girl hours, but at least it tells you why 😭.

πŸ’€ ERRORS πŸ’€

The libkeccak_state_duplicate() function may fail for any reason specified for the function malloc(3). So like, malloc stuff can happen β€” that's the whole mood. 🫑

πŸ”₯ SEE ALSO πŸ”₯


Byeee from the LIBKECCAK manual β€” source/version LIBKECCAK, plus the footer date as printed, mwah πŸŽ€πŸ’–βœ¨

πŸ“¦ where this page comes from