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

Using Keccak-P1600 Rho constant in Keccak-P800 #2

Open
sunshuzhou opened this issue Nov 5, 2017 · 3 comments
Open

Using Keccak-P1600 Rho constant in Keccak-P800 #2

sunshuzhou opened this issue Nov 5, 2017 · 3 comments

Comments

@sunshuzhou
Copy link
Contributor

There exists some errors in this file. The rho offset for Keccak-P800 should module 32 which means all the constants should smaller than 32. But I found that in https://github.com/kste/sphincs/blob/ee5af8e9cffecb33f3eecd0908b86c673ced3f63/x86/crypto_sign/sphincs256keccak/avx2/KeccakP-800-times8-SIMD256.c, some of the constants are larger than 31. Also, I look at the Keccak-P1600 implementation and find out that its constants are being used in Keccak-P800.

The above implementation error leads to the fail verification of SPHINCS when instantiate with Keccak-P800 (I tested it myself).

@kste
Copy link
Owner

kste commented Nov 6, 2017

Thank you for reporting this!

The ROL32in256() macro includes the necessary % operation for getting the correct constants, but I agree it would be better to just directly use the correct ones.

The round constants should match https://github.com/gvanas/KeccakCodePackage/blob/master/SnP/KeccakP-800/Optimized32/KeccakP-800-opt32.c , so the issue might be somewhere else.

@sunshuzhou
Copy link
Contributor Author

Alright, do you have any plan to fix or test this?

@kste
Copy link
Owner

kste commented Nov 15, 2017

I will have a look at it as soon as I find time!

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

No branches or pull requests

2 participants