[stdlib] Keccak, SHA-3, and other Keccak-derived functions#2728
Open
NotsoanoNimus wants to merge 38 commits intoc3lang:masterfrom
Open
[stdlib] Keccak, SHA-3, and other Keccak-derived functions#2728NotsoanoNimus wants to merge 38 commits intoc3lang:masterfrom
NotsoanoNimus wants to merge 38 commits intoc3lang:masterfrom
Conversation
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.
This PR adds a suite of SHA-3 and Keccak-based constructs to the C3 standard library. This finishes rounding out the more necessary sets of C3's cryptographic hashing functionalities, and will hopefully at least equalize the power of the language in this space with the others that have these functions in their standard libraries too.
Usage
All extensive unit-tests contain each construction's usage details by example. All function calls will be well documented when this is finished.
TODOs Remaining
ParallelHash(threading vs. "lanes" vs, others?)TupleHash(finish unit tests and fix any outstanding bugs)Finish2026-02-22: not happening in this PRKangarooTwelve(currently incomplete)At a Glance
I've included a diagram showing the high-level hierarchy used to guide me in implementing this change. The colors change the "further away" each construction is from the
Keccakbase context. Blue is no "inheritance", Green is 1 level of "inheritance", Yellow is 2, and Red is 3.This suite of functions of course uses the traditional concept of a cryptographic hash, but also incorporates the newer extendable output function (or XOF) for creating hashes with arbitrary lengths.