8000 Add WHIRLPOOL hashing to stdlib by NotsoanoNimus · Pull Request #2273 · c3lang/c3c · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add WHIRLPOOL hashing to stdlib #2273

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

NotsoanoNimus
Copy link
Contributor
@NotsoanoNimus NotsoanoNimus commented Jul 4, 2025

Dedicating my recent work on a WHIRLPOOL hashing library to the C3 stdlib.

This is an alternative way to generate a 512-bit hash that has a strong focus on security over speed. Therefore, it should be used in applications like digital signatures rather than latency-sensitive areas like real-time communication.

❗ ❗ ❗
A really neat thing about the C3 implementation is that it can successfully hash up to the original WHIRLPOOL's proclaimed 2^256 bits of data, unlike popular implementations such as RHash which can only do 2^64 bits for “optimization purposes”.

Additionally, C3's version has HMAC and PBKDF2: very rare to see these so accessible for WHIRLPOOL. :)
❗ ❗ ❗


Related unit tests have been run before committing and are passing:

--------------------------------- TESTS ----------------------------------
Testing std::hash::whirlpool_test::test_whirlpool_empty ............. [PASS]
Testing std::hash::whirlpool_test::test_whirlpool_expected_outputs .. [PASS]
Testing std::hash::whirlpool_test::test_whirlpool_gigahash_zeroes ... [PASS]
Testing std::hash::whirlpool_test::test_whirlpool_hmac .............. [PASS]
Testing std::hash::whirlpool_test::test_whirlpool_pbkdf2 ............ [PASS]
Testing std::hash::whirlpool_test::test_whirlpool_pbkdf2_2 .......... [PASS]
Testing std::hash::whirlpool_test::test_whirlpool_pbkdf2_3 .......... [PASS]
Testing std::hash::whirlpool_test::test_whirlpool_pbkdf2_4 .......... [PASS]
Testing std::hash::whirlpool_test::test_whirlpool_sweep_block_size .. [PASS]

9 tests run.

Test Result: PASSED: 9 passed, 0 failed, 0 skipped.
Program completed with exit code 0.

This limitation doesn't really need to be there because, per discussions, any slice going over the architecture's max native width for pointer lengths is broken anyhow.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0