mirror of https://github.com/status-im/EIPs.git
Automatically merged updates to draft EIP(s) 1057
Hi, I'm a bot! This change was automatically merged because: - It only modifies existing Draft or Last Call EIP(s) - The PR was approved or written by at least one author of each modified EIP - The build is passing
This commit is contained in:
parent
fa9655ce3d
commit
49358eb32a
|
@ -251,8 +251,9 @@ void merge(uint32_t &a, uint32_t b, uint32_t r)
|
|||
{
|
||||
case 0: a = (a * 33) + b; break;
|
||||
case 1: a = (a ^ b) * 33; break;
|
||||
case 2: a = ROTL32(a, ((r >> 16) % 32)) ^ b; break;
|
||||
case 3: a = ROTR32(a, ((r >> 16) % 32)) ^ b; break;
|
||||
// prevent rotate by 0 which is a NOP
|
||||
case 2: a = ROTL32(a, ((r >> 16) % 31) + 1) ^ b; break;
|
||||
case 3: a = ROTR32(a, ((r >> 16) % 31) + 1) ^ b; break;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
@ -329,8 +330,11 @@ void progPowLoop(
|
|||
if (i < PROGPOW_CNT_MATH)
|
||||
{
|
||||
// Random Math
|
||||
int src1 = kiss99(prog_rnd) % PROGPOW_REGS;
|
||||
int src2 = kiss99(prog_rnd) % PROGPOW_REGS;
|
||||
// Generate 2 unique sources
|
||||
int src_rnd = kiss99(prog_rnd) % (PROGPOW_REGS * (PROGPOW_REGS-1));
|
||||
int src1 = src_rnd % PROGPOW_REGS; // 0 <= src1 < PROGPOW_REGS
|
||||
int src2 = src_rnd / PROGPOW_REGS; // 0 <= src2 < PROGPOW_REGS - 1
|
||||
if (src2 >= src1) ++src2; // src2 is now any reg other than src
|
||||
int sel1 = kiss99(prog_rnd);
|
||||
int dst = mix_seq_dst[(mix_seq_dst_cnt++)%PROGPOW_REGS];
|
||||
int sel2 = kiss99(prog_rnd);
|
||||
|
|
Loading…
Reference in New Issue