---
name: "libkeccak_hmac_create"
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_create"
---

# libkeccak\_hmac\_create(3)

Allocate and initialise HMAC-hashing state

## NAME

libkeccak\_hmac\_create - Allocate and initialise HMAC-hashing state

## SYNOPSIS

```
#include <libkeccak.h>
struct libkeccak_hmac_state *libkeccak_hmac_create(const struct libkeccak_spec *spec, const void *key, size_t key_length);
```

Link with *-lkeccak*.

## DESCRIPTION

The **libkeccak\_hmac\_create**() function allocates a new *struct libkeccak\_hmac\_state \** with one initialised element, and sets the algorithm tuning parameters to those specified by *\*spec*, and the key to *key* of length *key\_length*.

## RETURN VALUES

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

## ERRORS

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

## SEE ALSO

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