2015-01-01 00:40:56 +00:00
|
|
|
// Generated from go run gen.go
|
|
|
|
// DO NOT EDIT
|
|
|
|
|
|
|
|
package keccak
|
|
|
|
|
2015-01-01 00:52:34 +00:00
|
|
|
// round implements one round of the keccak-f[1600] permutation.
|
2015-01-01 10:59:03 +00:00
|
|
|
func roundGo(a *[25]uint64) {
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
var b00, b01, b02, b03, b04 uint64
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
var b10, b11, b12, b13, b14 uint64
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
var b20, b21, b22, b23, b24 uint64
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
var b30, b31, b32, b33, b34 uint64
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
var b40, b41, b42, b43, b44 uint64
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 00:52:34 +00:00
|
|
|
// Theta
|
|
|
|
var c0, c1, c2, c3, c4 uint64
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
c0 = a[0]
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
c1 = a[1]
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
c2 = a[2]
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
c3 = a[3]
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
c4 = a[4]
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
c0 ^= a[5]
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
c1 ^= a[6]
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
c2 ^= a[7]
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
c3 ^= a[8]
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
c4 ^= a[9]
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
c0 ^= a[10]
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
c1 ^= a[11]
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
c2 ^= a[12]
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
c3 ^= a[13]
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
c4 ^= a[14]
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
c0 ^= a[15]
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
c1 ^= a[16]
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
c2 ^= a[17]
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
c3 ^= a[18]
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
c4 ^= a[19]
|
2015-01-01 00:52:34 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
c0 ^= a[20]
|
2015-01-01 00:52:34 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
c1 ^= a[21]
|
2015-01-01 00:52:34 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
c2 ^= a[22]
|
2015-01-01 00:52:34 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
c3 ^= a[23]
|
2015-01-01 00:52:34 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
c4 ^= a[24]
|
2015-01-01 00:52:34 +00:00
|
|
|
|
2015-01-01 01:52:09 +00:00
|
|
|
var d uint64
|
2015-01-01 00:52:34 +00:00
|
|
|
|
2015-01-01 01:52:09 +00:00
|
|
|
d = c4 ^ (c1<<1 | c1>>63)
|
2015-01-01 00:52:34 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b00 = a[0] ^ d
|
2015-01-01 00:52:34 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b01 = a[5] ^ d
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b02 = a[10] ^ d
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b03 = a[15] ^ d
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b04 = a[20] ^ d
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 01:52:09 +00:00
|
|
|
d = c0 ^ (c2<<1 | c2>>63)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b10 = a[1] ^ d
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b11 = a[6] ^ d
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b12 = a[11] ^ d
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b13 = a[16] ^ d
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b14 = a[21] ^ d
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 01:52:09 +00:00
|
|
|
d = c1 ^ (c3<<1 | c3>>63)
|
2015-01-01 00:52:34 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b20 = a[2] ^ d
|
2015-01-01 00:52:34 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b21 = a[7] ^ d
|
2015-01-01 00:52:34 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b22 = a[12] ^ d
|
2015-01-01 00:52:34 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b23 = a[17] ^ d
|
2015-01-01 00:52:34 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b24 = a[22] ^ d
|
2015-01-01 00:52:34 +00:00
|
|
|
|
2015-01-01 01:52:09 +00:00
|
|
|
d = c2 ^ (c4<<1 | c4>>63)
|
2015-01-01 00:52:34 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b30 = a[3] ^ d
|
2015-01-01 00:52:34 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b31 = a[8] ^ d
|
2015-01-01 00:52:34 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b32 = a[13] ^ d
|
2015-01-01 00:52:34 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b33 = a[18] ^ d
|
2015-01-01 00:52:34 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b34 = a[23] ^ d
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 01:52:09 +00:00
|
|
|
d = c3 ^ (c0<<1 | c0>>63)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b40 = a[4] ^ d
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b41 = a[9] ^ d
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b42 = a[14] ^ d
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b43 = a[19] ^ d
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b44 = a[24] ^ d
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 01:52:09 +00:00
|
|
|
// Rho
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b00 = b00<<0 | b00>>64
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b10 = b10<<1 | b10>>63
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b20 = b20<<62 | b20>>2
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b30 = b30<<28 | b30>>36
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b40 = b40<<27 | b40>>37
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b01 = b01<<36 | b01>>28
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b11 = b11<<44 | b11>>20
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b21 = b21<<6 | b21>>58
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b31 = b31<<55 | b31>>9
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b41 = b41<<20 | b41>>44
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b02 = b02<<3 | b02>>61
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b12 = b12<<10 | b12>>54
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b22 = b22<<43 | b22>>21
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b32 = b32<<25 | b32>>39
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b42 = b42<<39 | b42>>25
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b03 = b03<<41 | b03>>23
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b13 = b13<<45 | b13>>19
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b23 = b23<<15 | b23>>49
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b33 = b33<<21 | b33>>43
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b43 = b43<<8 | b43>>56
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b04 = b04<<18 | b04>>46
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b14 = b14<<2 | b14>>62
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b24 = b24<<61 | b24>>3
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b34 = b34<<56 | b34>>8
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
b44 = b44<<14 | b44>>50
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 01:52:09 +00:00
|
|
|
// Pi / Chi / output
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
a[0] = b00 ^ (b22 &^ b11)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
a[1] = b11 ^ (b33 &^ b22)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
a[2] = b22 ^ (b44 &^ b33)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
a[3] = b33 ^ (b00 &^ b44)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
a[4] = b44 ^ (b11 &^ b00)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
a[5] = b30 ^ (b02 &^ b41)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
a[6] = b41 ^ (b13 &^ b02)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
a[7] = b02 ^ (b24 &^ b13)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
a[8] = b13 ^ (b30 &^ b24)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
a[9] = b24 ^ (b41 &^ b30)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
a[10] = b10 ^ (b32 &^ b21)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
a[11] = b21 ^ (b43 &^ b32)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
a[12] = b32 ^ (b04 &^ b43)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
a[13] = b43 ^ (b10 &^ b04)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
a[14] = b04 ^ (b21 &^ b10)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
a[15] = b40 ^ (b12 &^ b01)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
a[16] = b01 ^ (b23 &^ b12)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
a[17] = b12 ^ (b34 &^ b23)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
a[18] = b23 ^ (b40 &^ b34)
|
2015-01-01 01:52:09 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
a[19] = b34 ^ (b01 &^ b40)
|
2015-01-01 01:52:09 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
a[20] = b20 ^ (b42 &^ b31)
|
2015-01-01 01:52:09 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
a[21] = b31 ^ (b03 &^ b42)
|
2015-01-01 01:52:09 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
a[22] = b42 ^ (b14 &^ b03)
|
2015-01-01 01:52:09 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
a[23] = b03 ^ (b20 &^ b14)
|
2015-01-01 01:52:09 +00:00
|
|
|
|
2015-01-01 10:59:03 +00:00
|
|
|
a[24] = b14 ^ (b31 &^ b20)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
|
|
|
}
|