LIBKECCAK_ZEROCOPY_UPDATE(3)

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

πŸ’– NAME

Okay so this page is LIBKECCAK_...COPY_UPDATE(3) from the LIBKECCAK Library Functions Manual, and it’s all about libkeccak_zerocopy_update β€” partially hash a message without copying. (ADVANCED). Bestie, this one is giving low-level main character energy. πŸ’…

πŸ“œ SYNOPSIS

#include <libkeccak.h>

void libkeccak_zerocopy_update(struct libkeccak_state *state, const void *msg, size_t msglen);

Link with -lkeccak.

✨ DESCRIPTION ✨

libkeccak_zerocopy_update() continues a hash β€” or starts one, no big deal β€” for a message. The current hashing state lives in *state, and it gets updated. The message you pass as msg, with the byte-size given by msglen, gets hashed. Slay. πŸ¦‹

Here’s the special restriction just for libkeccak_zerocopy_update(): msglen must be an integer multiple of the bitrate divided by eight. That number is returned by libkeccak_zerocopy_chunksize(3). If you need to dodge the restriction, libkeccak_update(3) or libkeccak_fast_update(3) can do it β€” but heads up, unlike libkeccak_zerocopy_update(), those will copy the message and move around copied data. Periodt.

🫢 RETURN VALUES

libkeccak_zerocopy_update() does not return a value. Like, nothing. Not a crumb. πŸ’€

πŸ’€ ERRORS

libkeccak_zerocopy_update() cannot fail. Iconic behavior, honestly. πŸ‘‘

🌸 NOTES

Neither parameter may be NULL or 0. That is not the vibe. πŸ™ˆ

It is safe to call libkeccak_zerocopy_update() before libkeccak_update(3), libkeccak_fast_update(3), libkeccak_digest(3), and libkeccak_fast_digest(3) with the same state argument. However, calling libkeccak_zerocopy_update() after libkeccak_update(3) or libkeccak_fast_update(3) may cause the message to be misread. So don’t do that, fr fr. 😭

🌟 NOTES β€” cSHAKE edition 🌟

For cSHAKE, libkeccak_cshake_initialise(3) must be called, once, immediately after state initialisation; before the first call to libkeccak_zerocopy_update(). That’s the order, bestie. Periodt. 🧚

πŸ‘€ SEE ALSO


πŸ’– cute sign-off: this gem is from the LIBKECCAK manual, page LIBKECCAK_...COPY_UPDATE(3), and the footer does not print a date β€” so here’s your source/version + date acknowledgement: LIBKECCAK, LIBKECCAK_...COPY_UPDATE(3), date not shown in the original footer. Bye bestie, go hash something beautiful. πŸŽ€βœ¨

πŸ“¦ where this page comes from