---
name: "libkeccak_hmac_duplicate"
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_duplicate"
---

# libkeccak\_hmac\_duplicate(3)

Allocate a duplicate an HMAC-hashing state

## NAME

libkeccak\_hmac\_duplicate - Allocate a duplicate an HMAC-hashing state

## SYNOPSIS

```
#include <libkeccak.h>
struct libkeccak_hmac_state *libkeccak_hmac_duplicate(const struct libkeccak_hmac_state *src);
```

Link with *-lkeccak*.

## DESCRIPTION

The **libkeccak\_hmac\_duplicate**() function allocates a new hash state and initialises it to be identical to *\*src*. This includes all members of the **struct libkeccak\_hmac\_state** structure, including the state of the sponge and the message chunk buffer.

## RETURN VALUES

The **libkeccak\_hmac\_duplicate**() function returns a newly allocated *libkeccak\_hmac\_t\** (of one initialised element) upon successful completion. On error, *NULL* is returned and *errno* is set to describe the error.

## ERRORS

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

## SEE ALSO

[**libkeccak\_hmac\_copy**(3)](/libkeccak_hmac_copy/3.md), [**libkeccak\_hmac\_create**(3)](/libkeccak_hmac_create/3.md)
