-
Notifications
You must be signed in to change notification settings - Fork 88
cSHAKE implementation produces invalid output #24
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
Comments
For |
cshake128/256
for example
|
Thank you for reporting. Will fix in next version. |
emn178
added a commit
that referenced
this issue
Aug 30, 2023
### Fixed - cSHAKE bug. #24 - dependencies and security issues.
emn178
added a commit
that referenced
this issue
Aug 31, 2023
### Fixed - cSHAKE empty Array bug. #24
fixed in v0.9.1, please check. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You have issue with cshake implementation here:
js-sha3/src/sha3.js
Line 326 in b39d091
it should be
var paddingBytes = (w - bytes % w) % w;
, since it should not pad if value is already divisible by block size without remainder.(spec: https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-185.pdf: bytepad function step 3 here:
while (len(z)/8) mod w ≠ 0:
We encountered the same error in noble-hashes, which contains XKCP-generated test vectors
Test case which triggers the error:
Instead, it returns
bc58e9c8534e5fa7346f06e6ab25e2db
The text was updated successfully, but these errors were encountered: