---
name: "libkeccak_hmac_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_hmac_update"
---

# libkeccak\_hmac\_update(3)

Partially HMAC-hash a message with erasure

## NAME

libkeccak\_hmac\_update - Partially HMAC-hash a message with erasure

## SYNOPSIS

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

Link with *-lkeccak*.

## DESCRIPTION

The **libkeccak\_hmac\_update**() function continues (or starts) HMAC-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.

The **libkeccak\_hmac\_update**() function may reallocate the state's message chunk buffer. When doing so, it attempts to do so as securely as possible, rather than as fast as possible.

## RETURN VALUES

The **libkeccak\_hmac\_update**() function returns 0 upon successful completion. On error, -1 is returned and *errno* is set to describe the error.

## ERRORS

The **libkeccak\_hmac\_update**() function may fail for any reason specified by the function [**malloc**(3)](/malloc/3.md).

## NOTES

Neither parameter by be *NULL* or 0.

## SEE ALSO

[**libkeccak\_hmac\_create**(3)](/libkeccak_hmac_create/3.md), [**libkeccak\_hmac\_initialise**(3)](/libkeccak_hmac_initialise/3.md), [**libkeccak\_hmac\_digest**(3)](/libkeccak_hmac_digest/3.md), [**libkeccak\_hmac\_fast\_update**(3)](/libkeccak_hmac_fast_update/3.md)
