---
name: "libkeccak_state_unmarshal"
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_state_unmarshal"
---

# libkeccak\_state\_unmarshal(3)

Unharshals a hash state

## NAME

libkeccak\_state\_unmarshal - Unharshals a hash state

## SYNOPSIS

```
#include <libkeccak.h>
size_t libkeccak_state_unmarshal(struct libkeccak_state *state, const void *data);
```

Link with *-lkeccak*.

## DESCRIPTION

The **libkeccak\_state\_unmarshal**() function unmarshals a hash state from the beginning of *data*. and stores it in *\*state*. *state* may be *NULL*.

## RETURN VALUES

The **libkeccak\_state\_unmarshal**() returns the number of bytes reads from *data* upon successful completion. On error, -1 is returned and *errno* is set to describe the error. If *state* is *NULL*, the number the function will always be successful and return a positive value, this value is the number of bytes that make un the marshalled state.

## ERRORS

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

## SEE ALSO

[**libkeccak\_state\_marshal**(3)](/libkeccak_state_marshal/3.md)
