# std/crypto/hmac: remove HmacBlake2s256 definition · gitcafe/zig

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

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

Visibility: public

Requested revision: cb44f27104937682ffaa42ec133e56595e4f08d0

Requested commit: cb44f27104937682ffaa42ec133e56595e4f08d0

Commit: cb44f27104937682ffaa42ec133e56595e4f08d0

Tree: 04e29b53b10c4db6c4ea31985e333b92e4e0cdc1

Author: Frank Denis

Committer: Andrew Kelley

## Message

```
std/crypto/hmac: remove HmacBlake2s256 definition

HMAC is a generic construction, so we allow it to be instantiated
with any hash function.

In practice, HMAC is almost exclusively used with MD5, SHA1 and SHA2,
so it makes sense to define some shortcuts for them.

However, defining `HmacBlake2s256` is a bit weird (and why
specifically that one, and not other hash functions we also support?).
There would be nothing wrong with that construction, but it's not
used in any standard protocol and would be a curious choice.

BLAKE2 being a keyed hash function, it doesn't need HMAC to be used as
a MAC, so that also doesn't make it a good example of a possible hash
function for HMAC.

This commit doesn't remove the ability to use a Hmac(Blake2s256) type
if, for some reason, applications really need this, but it removes
HmacBlake2s256 as a constant.

```

## Parents

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

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