LIBKECCAK_STATE_COPY(3)

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

okay so bestie, we're in LIBKECCAK_STATE_COPY(3) from the Library Functions Manual, and this is the tiny but iconic copy function that deserves main character energy βœ¨πŸ’…


✨ NAME ✨

  • libkeccak_state_copy β€” copies hash state, and yes that's the whole vibe 🫢

πŸ¦‹ SYNOPSIS πŸ¦‹

#include <libkeccak.h>

int libkeccak_state_copy(struct libkeccak_state *dest, const struct libkeccak_state *src);

Link with -lkeccak.


🌸 DESCRIPTION 🌸

So libkeccak_state_copy() initialises *dest to be identical to *src β€” like, a full copy-paste glow-up, no cap πŸ’–

This includes all members of the struct libkeccak_state structure, including the state of the sponge and the message chunk buffer. Every little detail gets copied, bestie β€” the whole struct is giving matched-set energy πŸŽ€


πŸ’– RETURN VALUES πŸ’–

  • It returns 0 upon successful completion β€” slay, we love a clean exit ✨
  • On error, -1 is returned and errno is set to describe the error 😭

😭 ERRORS 😭

The libkeccak_state_copy() function may fail for any specified for the function malloc(3). Yep, it's got the same failure energy as malloc(3) β€” no extra lore, just that πŸ’€


πŸ”₯ SEE ALSO πŸ”₯


mwah πŸ’‹ β€” sourced from LIBKECCAK, page LIBKECCAK_STATE_COPY(3); the footer didn't print a date, so we're not inventing one, bestie πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from