I am implementing a Keccak core in VHDL and I am currently almost done yet I am still facing some problems and would appreciate your insight. First of all I wanna ask about the padding, I know that we use the pad10*1 rule where we take the input, we concatenate the specific binary string MBIT then a '1' followed by a string of '0's then a final '1'. This would be how it is implemented in hardware where you have control over every bit, however in software implementations I found they use bytes so when adding '1' they would be adding "0001" so for example I have this input, which is the same input I will using for the rest of the tests, 123456789111111912345678911111191234567891111119123456789111111912345678911111191234567891111119123456789111111912345678911111191234567891111119

following this website for SHAKE-128 the padded value would be : 1234567891111119123456789111111912345678911111191234567891111119123456789111111912345678911111191234567891111119123456789111111912345678911111191F0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080

where in the bit level hardware implementation the result would be this 1234567891111119123456789111111912345678911111191234567891111119F80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 so I would like to know about this point, does it make a difference and why? the official specification said nothing about this being byte specific.

I have another question, in the same website it shows you all the steps the state takes through the hashing process, and the first step before the permutation is what they called

Before first round

    1911119178563412    ||1911119178563412  ||0000000000000000  ||0000000000000000  ||8000000000000000  ||
1911119178563412    ||1911119178563412  ||0000000000000000  ||0000000000000000  ||0000000000000000  ||
1911119178563412    ||1911119178563412  ||0000000000000000  ||0000000000000000  ||0000000000000000  ||
1911119178563412    ||1911119178563412  ||0000000000000000  ||0000000000000000  ||0000000000000000  ||
1911119178563412    ||000000000000001f  ||0000000000000000  ||0000000000000000  ||0000000000000000  ||

if you look at the website you'll find (from what I understand) that this is the state that gets inserted into the permutation, so please if anyone can help me understand this one because I have never seen this before I was under the impression that the padded input xored with the zero initial state would be the state that gets inserted into the permutation.

The last thing is in the same website towards the end of the process the last value the iota state outputs at the 24th round is

9ffc8b73338a8bb9    ||b20580154ef5c6dc  ||3752008c137f1854  ||e7fcc10abe408b71  ||ceb555d8d1c3076e  ||
7159bdcef9c3e85d    ||5b7d8de67e4acb75  ||75dd15b819205532  ||a184c98e97caeb64  ||3015fd3fd87b1057  ||
21a7ddaaed27097c    ||579d7b4704961927  ||5206d7eb2aef0825  ||c0815e38d5e938c7  ||620b2ff9c0ed3838  ||
bbf6c3efd88ea7dd    ||c07410727856ed41  ||821dfe5e46abd8ed  ||8829b8750f72a32d  ||45f62a6a54a657ba  ||
e84988c9316d8d6b    ||f5593e2afa7337ee  ||51cee912fe410bef  ||b86eb1f614b90530  ||1534d4b65b396a91  ||

then it says

Value after squeezing : b98b8a33738bfc9f5de8c3f9cebd5971

I don't understand what step is there here, the squeezing is taking the output of the absorb state then concatenating to itself, itself through the permutation if output is still needed so how do we get to this?

Thanks for your help



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.