---
name: "libkeccak_zerocopy_update"
section: "3"
platform: "linux"
package: "libkeccak"
version: "1.4.3-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libkeccak_zerocopy_update"
---

# libkeccak\_zerocopy\_update(3)

Partially hash a message without copying (ADVANCED)

## 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)](/libkeccak_zerocopy_chunksize/3.md) function. The [**libkeccak\_update**(3)](/libkeccak_update/3.md) or [**libkeccak\_fast\_update**(3)](/libkeccak_fast_update/3.md) 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_update/3.md), [**libkeccak\_fast\_update**(3)](/libkeccak_fast_update/3.md) [**libkeccak\_digest**(3)](/libkeccak_digest/3.md) and [**libkeccak\_fast\_digest**(3)](/libkeccak_fast_digest/3.md) functions with the same *state* argument. However, calling the **libkeccak\_zerocopy\_update**() function after the [**libkeccak\_update**(3)](/libkeccak_update/3.md) or [**libkeccak\_fast\_update**(3)](/libkeccak_fast_update/3.md) functions may cause the message to be misread.

## NOTES

For cSHAKE, the [**libkeccak\_cshake\_initialise**(3)](/libkeccak_cshake_initialise/3.md), must be called, once, immediately after state initialisation; before the first call to the **libkeccak\_zerocopy\_update**() function.

## SEE ALSO

[**libkeccak\_state\_initialise**(3)](/libkeccak_state_initialise/3.md), [**libkeccak\_cshake\_initialise**(3)](/libkeccak_cshake_initialise/3.md), [**libkeccak\_zerocopy\_chunksize**(3)](/libkeccak_zerocopy_chunksize/3.md), [**libkeccak\_fast\_update**(3)](/libkeccak_fast_update/3.md), [**libkeccak\_update**(3)](/libkeccak_update/3.md), [**libkeccak\_fast\_digest**(3)](/libkeccak_fast_digest/3.md), [**libkeccak\_zerocopy\_digest**(3)](/libkeccak_zerocopy_digest/3.md), [**libkeccak\_digest**(3)](/libkeccak_digest/3.md)
