LIBKECCAK_ZEROCOPY_UPDATE(3)
π 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 beNULLor0. 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
libkeccak_state_initialise(3)libkeccak_cshake_initialise(3)libkeccak_zerocopy_chunksize(3)libkeccak_fast_update(3)libkeccak_update(3)libkeccak_fast_digest(3)libkeccak_zerocopy_digest(3)libkeccak_digest(3)
π 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
- 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