LIBKECCAK_STATE_FREE(3)
π LIBKECCAK_STATE_FREE(3) β bestie, it's time to say goodbye π
okay so real talk, this page lives in the Library Functions Manual (the libkeccak girlies know β¨), and it's about one lil function that cleans up your hash state and erases the evidence. literally the Marie Kondo of the libkeccak world π
β¨ SYNOPSIS β¨
#include <libkeccak.h>
void libkeccak_state_free(struct libkeccak_state *state);
and bestie, don't forget to link with -lkeccak or it's giving nothing π₯
π«Ά DESCRIPTION π«Ά
so libkeccak_state_free() does two things and it does them both:
- it releases the allocations stored in
*stateπ - and then it also releases the allocation of
stateitself β yes, the whole thing, gone, iconic π
and here's the part where she's actually the main character: libkeccak_state_free() securely erases sensitive data. no cap. the secrets do not survive this. π΅οΈββοΈβ¨
πΈ RETURN VALUES πΈ
libkeccak_state_free() does not return any value. it's a void, she simply leaves. no dramatic exit speech, just vibes π
π¦ ERRORS π¦
libkeccak_state_free() cannot fail. literally cannot. she's unbothered, moisturized, thriving π
π NOTES π
okay this is the important one, pay attention bestie π
a double call to libkeccak_state_free() will either:
- result in a double free, which is must likely to crash the process π β like, full on RIP
- or free an allocation (that was created between the calls) that was not intended to be freed β resulting in undefined behaviour ππ«
so yeah. call it once. once. periodt. π
π SEE ALSO π
the whole friend group, fr fr:
libkeccak_state_destroy(3)libkeccak_state_fast_free(3)libkeccak_state_create(3)libkeccak_state_initialise(3)libkeccak_state_reset(3)libkeccak_state_wipe(3)
and that's the page, bestie π§ this came to you straight from LIBKECCAK (source, version and date all folded into that footer, which we are not copy-pasting, respectfully π) β go forth and free responsibly ππ
π¦ where this page comes from
- arch rolling: libkeccak 1.4.3-1 Β· custom:ISC
- opensuse-leap 16.0: libkeccak-devel 1.4-bp160.1.13 Β· ISC
- opensuse-leap 16.0: libkeccak-devel 1.4-bp160.1.13 Β· ISC
- opensuse-leap 16.0: libkeccak-devel 1.4-bp160.1.13 Β· ISC
- opensuse-leap 16.0: libkeccak-devel 1.4-bp160.1.13 Β· ISC
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms