std.crypto: add Ascon-AEAD, Ascon-Hash, Ascon-CHash - #25239
Merged
Merged
Conversation
Ascon is the family of cryptographic constructions standardized by NIST for lightweight cryptography. The Zig standard library already included the Ascon permutation itself, but higher-level constructions built on top of it were intentionally postponed until NIST released the final specification. That specification has now been published as NIST SP 800-232: https://csrc.nist.gov/pubs/sp/800/232/final With this publication, we can now confidently include these constructions in the standard library.
Rexicon226
reviewed
Sep 15, 2025
andrewrk
approved these changes
Sep 18, 2025
|
|
||
| pub fn main() !void { | ||
| const stdout = std.fs.File.stdout().deprecatedWriter(); | ||
| var stdout_buffer: [4096]u8 = undefined; |
Member
There was a problem hiding this comment.
If you flush after every write, there's no need for a buffer. Recommend to either pass an empty buffer, and remove all the flush() calls, or flush only once at the end.
Member
|
This broke RISC-V CI: https://github.com/ziglang/zig/actions/runs/17816622839/job/50650980744 For future reference, you can add the https://github.com/ziglang/zig/labels/ci-riscv64-linux label to a PR to get RISC-V CI running on it. This can be a good idea to do whenever new algorithms/tests are added to |
Contributor
Author
|
Noted. Thanks @alexrp ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ascon is the family of cryptographic constructions standardized by NIST for lightweight cryptography.
The Zig standard library already included the Ascon permutation itself, but higher-level constructions built on top of it were intentionally postponed until NIST released the final specification.
That specification has now been published as NIST SP 800-232: https://csrc.nist.gov/pubs/sp/800/232/final
With this publication, we can now confidently include these constructions in the standard library.
Also unbreak the benchmarks after the
deprecatedWriter()removal.