LIBKECCAK_ZEROCOPY_UPDATE(3)

NAME
libkeccak_zerocopy_update - Partially hash a message without copying (ADVANCED)

SYNOPSIS
#include <libkeccak.h>
void libkeccak_zerocopy_update(struct libkeccak_state *state, const void *msg, size_t msglen);

Link with -lkeccak.

DESCRIPTION
The libkeccak_zerocopy_update() function continues (or starts) hashing a message. The current state of the hashing is stored in *state, and will be updated. The message specified by the msg parameter with the byte-size specified by the msglen parameter, will be hashed.

As a restriction specific to the libkeccak_zerocopy_update() function, the msglen argument must be an integer multiple of the bitrate divided by eight. This is returned by the libkeccak_zerocopy_chunksize(3) function. The libkeccak_update(3) or libkeccak_fast_update(3) functions can be used to avoid this restriction, but these, unlike the libkeccak_zerocopy_update() function, will copy the message and move around copied data.

RETURN VALUES
The libkeccak_zerocopy_update() function does not return a value.

ERRORS
The libkeccak_zerocopy_update() function cannot fail.

NOTES
Neither parameter by be NULL or 0.

It is safe call the libkeccak_zerocopy_update() function before the libkeccak_update(3), libkeccak_fast_update(3) libkeccak_digest(3) and libkeccak_fast_digest(3) functions with the same state argument. However, calling the libkeccak_zerocopy_update() function after the libkeccak_update(3) or libkeccak_fast_update(3) functions may cause the message to be misread.

SEE ALSO
libkeccak_state_initialise(3), libkeccak_zerocopy_chunksize(3), libkeccak_fast_update(3), libkeccak_update(3), libkeccak_fast_digest(3), libkeccak_zerocopy_digest(3), libkeccak_digest(3)