de-unroll Chi loop in roundGeneric

(reroll? no, that's something else)

makes it more similar to the templatized code in gen.go. this isn't the
optimized code, so performance doesn't matter.
master
magical 2024-10-05 20:54:51 -07:00
parent 5e1178f8c2
commit 055806bbad
1 changed files with 3 additions and 5 deletions

View File

@ -26,11 +26,9 @@ func roundGeneric(a *[25]uint64) {
// Chi
for y := 0; y < 5; y++ {
a[y*5+0] = b[y][0] ^ ^b[y][1]&b[y][2]
a[y*5+1] = b[y][1] ^ ^b[y][2]&b[y][3]
a[y*5+2] = b[y][2] ^ ^b[y][3]&b[y][4]
a[y*5+3] = b[y][3] ^ ^b[y][4]&b[y][0]
a[y*5+4] = b[y][4] ^ ^b[y][0]&b[y][1]
for x := 0; x < 5; x++ {
a[y*5+x] = b[y][x] ^ (^b[y][(x+1)%5] & b[y][(x+2)%5])
}
}
}