Question
panicape opened this issue · 5 comments
Good morning / Afternoon / evening
I would like to know if this implementation is correct or not. I check comments and it says that it generates an invalid hash, could be nice more detailed comments.
if this implementation is wrong, do you know when can i find a good implementation of sha-3 algorithm?
ok, thanks
So in this reference there is only an implementation in js but not in java, isn't it?
Yep. This is javascript implementation.
I provide the FIPS 202 changes when I will have time...
I analysed your code and in your code is one thing what you should do to provide the FIPS 202. In padding method you are adding to message "01"(for the plain Keccak), if you add "06" you will get SHA3-224, SHA3-256, SHA3-384, SHA3-512 and if you add "1f" you will get SHAKE128 or SHAKE256.
In the FIPS 202, byte "01" is named as d, but in your code it is output length in bytes.
See table 3 here.
Thx @aradej006 !
Implementation here - 91c2be1