scarv / xcrypto

XCrypto: a cryptographic ISE for RISC-V
MIT License
90 stars 10 forks source link

Instruction Proposal: xc.sha3.ind #56

Closed ben-marshall closed 5 years ago

ben-marshall commented 5 years ago

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:

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.