Skip to content
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

2.0.0: FIPS 202 SHA-3 standard hash algorithms and SHAVS test vectors #25

Closed
wants to merge 3 commits into from
Closed

Conversation

skull-squadron
Copy link

Closes #14

@skull-squadron
Copy link
Author

Ready to merge and release.

cc: @FooBarWidget

@skull-squadron skull-squadron mentioned this pull request Mar 21, 2016
@skull-squadron
Copy link
Author

TL;DR Keccak reference implementation -> FIPS 202 patch

--- KeccakSponge.c.orig 2016-03-21 00:20:19.000000000 -0700
+++ KeccakSponge.c  2016-03-20 11:07:20.000000000 -0700
@@ -200,13 +200,13 @@
 {
     // Note: the bits are numbered from 0=LSB to 7=MSB
     if (state->bitsInQueue + 1 == state->rate) {
-        state->dataQueue[state->bitsInQueue/8 ] |= 1 << (state->bitsInQueue % 8);
+        state->dataQueue[state->bitsInQueue/8 ] |= 6 << (state->bitsInQueue % 8);
         AbsorbQueue(state);
         memset(state->dataQueue, 0, state->rate/8);
     }
     else {
         memset(state->dataQueue + (state->bitsInQueue+7)/8, 0, state->rate/8 - (state->bitsInQueue+7)/8);
-        state->dataQueue[state->bitsInQueue/8 ] |= 1 << (state->bitsInQueue % 8);
+        state->dataQueue[state->bitsInQueue/8 ] |= 6 << (state->bitsInQueue % 8);
     }
     state->dataQueue[(state->rate-1)/8] |= 1 << ((state->rate-1) % 8);
     AbsorbQueue(state);

There are simpler, shorter implementations out there as well.

References

@canterberry
Copy link
Collaborator

canterberry commented Apr 29, 2018

Sorry for the very long delay on this PR.

I completely agree with #14 that this library is a bit of a misnomer. There are consumers downstream, however, that are using it intentionally to provide the Keccak variant. Even with a major version bump, if the library suddenly begins to produce a different hash, it could cause some trouble. To that end, I propose an iterative approach vs a rewrite.

Since the discussion on #14 is dated and closed, I'll create some follow-up issues to try and establish a plan for how to move forward, and we'll make this happen!

@canterberry
Copy link
Collaborator

Created #36 as a follow-up for a phased rollout of SHA-3.

@canterberry canterberry added the abandoned Author has abandoned this work label Oct 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
abandoned Author has abandoned this work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants