# std.crypto: add the Ascon permutation · gitcafe/zig

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

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

Visibility: public

Requested revision: f62e3b8c0dd232bddb559405b00c1c1c4815f359

Requested commit: f62e3b8c0dd232bddb559405b00c1c1c4815f359

Commit: f62e3b8c0dd232bddb559405b00c1c1c4815f359

Tree: 3c3b2d6bc3ad5290db72f2bf545ff71a20f24a02

Author: Frank Denis

Committer: Andrew Kelley

## Message

```
std.crypto: add the Ascon permutation

Ascon has been selected as new standard for lightweight cryptography
in the NIST Lightweight Cryptography competition.

Ascon won over Gimli and Xoodoo.

The permutation is unlikely to change. However, NIST may tweak
the constructions (XOF, hash, authenticated encryption) before
standardizing them. For that reason, implementations of those
are better maintained outside the standard library for now.

In fact, we already had an Ascon implementation in Zig:
`std.crypto.aead.isap` is based on it. While the implementation was
here, there was no public API to access it directly.

So:

- The Ascon permutation is now available as `std.crypto.core.Ascon`,
with everything needed to use it in AEADs and other Ascon-based
constructions
- The ISAP implementation now uses std.crypto.core.Ascon instead of
keeping a private copy
- The default CSPRNG replaces Xoodoo with Ascon. And instead of an
ad-hoc construction, it's using the XOFa mode of the NIST submission.

```

## Parents

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

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