So, when I ported the code to a device that didn't support SSE, I experienced an "unexplained result error" in release build (because of uninitialized xof_length has the random value). The debug build is completely correct.
I spent two days debugging and finally found the problem here. I think the following code will be safer:
https://github.com/nicehash/nheqminer/blob/b9900ff8e3c6f8e5a46af18db454f2a2082d9f46/cpu_tromp/equi.h#L56
The problem is that
blake2b_param
doesn't have to be 11 members, sometimes it can be 12:https://github.com/BLAKE2/BLAKE2/blob/320c325437539ae91091ce62efec1913cd8093c2/ref/blake2.h#L108
This non-SSE version of the blake2 implementation has 12 members in
blake2b_param
:So, when I ported the code to a device that didn't support SSE, I experienced an "unexplained result error" in release build (because of uninitialized
xof_length
has the random value). The debug build is completely correct.I spent two days debugging and finally found the problem here. I think the following code will be safer: