I\'m working on an implementation of one of the SHA3 candidates, JH. I\'m at the point where the algorithm pass all KATs (Known Answer Tests) provided by NIST, and have also mad
!
)Block1024
as you did with Block512
(or at least use UnboxedTuples
)unsafeShift{R,L}
so you don't incur the check on the shift value (coming in GHC 7.4)roundFunction
so you have one rather ugly and verbose e8
function. This was significat in pureMD5 (the rolled version was prettier but massively slower than the unrolled version). You might be able to use TH to do this and keep the code smallish. If you do this then you'll have no need for constants
as these values will be explicit in the code and result in a more cache friendly binary.Word128
values.Word128
, don't lift Integer
. See LargeWord for an example of how this can be done.-O2
) and try llvm (-fllvm
)EDIT: And cabalize your git repo along with a benchmark so we can help you easier ;-). Good work on including a crypto-api instance.