Much of the compute inside Keccak state functions is actually computing address indexes into the state array.
Specifically, the function:
index(x,y):
return (x%5) + 5*(y%5)
Where it is called as:
index(x,y)
index(x+1, y)
index(x+2, y)
index(y, 2x+3y)
An instruction to compute these indexes, and possibly post-shift the output to automatically byte/halfword/word/dword align it would be very useful. Expecially so for very low end microcontrollers which need to comptue SHA3, but which do not want to be encumberd by implementing the RISC-V M extension needed for the remu instruction.
Much of the compute inside Keccak state functions is actually computing address indexes into the state array.
Specifically, the function:
Where it is called as:
index(x,y)
index(x+1, y)
index(x+2, y)
index(y, 2x+3y)
An instruction to compute these indexes, and possibly post-shift the output to automatically byte/halfword/word/dword align it would be very useful. Expecially so for very low end microcontrollers which need to comptue SHA3, but which do not want to be encumberd by implementing the RISC-V
M
extension needed for theremu
instruction.