---
name: "libkeccak_hmac_copy"
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_copy"
---

# libkeccak\_hmac\_copy(3)

Copies an HMAC-hashing state

## NAME

libkeccak\_hmac\_copy - Copies an HMAC-hashing state

## SYNOPSIS

```
#include <libkeccak.h>
int libkeccak_hmac_copy(struct libkeccak_hmac_state *dest, const struct libkeccak_hmac_state *src);
```

Link with *-lkeccak*.

## DESCRIPTION

The **libkeccak\_hmac\_copy**() function initialises *\*dest* 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\_copy**() function returns 0 upon successful completion. On error, -1 is returned and *errno* is set to describe the error.

## ERRORS

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

## SEE ALSO

[**libkeccak\_hmac\_duplicate**(3)](/libkeccak_hmac_duplicate/3.md), [**libkeccak\_hmac\_initialise**(3)](/libkeccak_hmac_initialise/3.md)
