# hkdf: add prk_length and extractInit\(\) · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/0d83487dd098f9498d907f06535e645cc8bcf3de)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 0d83487dd098f9498d907f06535e645cc8bcf3de

Requested commit: 0d83487dd098f9498d907f06535e645cc8bcf3de

Commit: 0d83487dd098f9498d907f06535e645cc8bcf3de

Tree: 28e9dd0bc357ea10fb6b8d8638709ebe4470ca25

Author: Frank Denis

Committer: Andrew Kelley

## Message

```
hkdf: add prk_length and extractInit()

The HKDF extract function uses HMAC under the hood, but requiring
applications to directly use HMAC functions reduces clarity and
feels like the wrong abstraction.

So, in order to get the PRK length, add a `prk_length` constant
that applications can use directly.

Also add an `extractInit()` function for cases where the keying
material has to be provided as multiple chunks.

```

## Parents

- [9b665a59f27b4de0ae648438617b0a1a08a620c1](https://git.cafe/gitcafe/zig/commit/9b665a59f27b4de0ae648438617b0a1a08a620c1?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/0d83487dd098f9498d907f06535e645cc8bcf3de?format=markdown)
