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 11:06:32 +00:00
|
|
|
c0 = a[0] ^ a[5] ^ a[10] ^ a[15] ^ a[20]
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
c1 = a[1] ^ a[6] ^ a[11] ^ a[16] ^ a[21]
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
c2 = a[2] ^ a[7] ^ a[12] ^ a[17] ^ a[22]
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
c3 = a[3] ^ a[8] ^ a[13] ^ a[18] ^ a[23]
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
c4 = a[4] ^ a[9] ^ a[14] ^ a[19] ^ 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-03 09:40:42 +00:00
|
|
|
// Rho / Pi
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
c0 = b00<<0 | b00>>64
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
c1 = b11<<44 | b11>>20
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
c2 = b22<<43 | b22>>21
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
c3 = b33<<21 | b33>>43
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
c4 = b44<<14 | b44>>50
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-03 09:40:42 +00:00
|
|
|
// Chi
|
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
a[0] = c0 ^ (c2 &^ c1)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
a[1] = c1 ^ (c3 &^ c2)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
a[2] = c2 ^ (c4 &^ c3)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
a[3] = c3 ^ (c0 &^ c4)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
a[4] = c4 ^ (c1 &^ c0)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-03 09:40:42 +00:00
|
|
|
// Rho / Pi
|
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
c0 = b30<<28 | b30>>36
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
c1 = b41<<20 | b41>>44
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
c2 = b02<<3 | b02>>61
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
c3 = b13<<45 | b13>>19
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
c4 = b24<<61 | b24>>3
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-03 09:40:42 +00:00
|
|
|
// Chi
|
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
a[5] = c0 ^ (c2 &^ c1)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
a[6] = c1 ^ (c3 &^ c2)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
a[7] = c2 ^ (c4 &^ c3)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
a[8] = c3 ^ (c0 &^ c4)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
a[9] = c4 ^ (c1 &^ c0)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-03 09:40:42 +00:00
|
|
|
// Rho / Pi
|
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
c0 = b10<<1 | b10>>63
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
c1 = b21<<6 | b21>>58
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
c2 = b32<<25 | b32>>39
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
c3 = b43<<8 | b43>>56
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
c4 = b04<<18 | b04>>46
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-03 09:40:42 +00:00
|
|
|
// Chi
|
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
a[10] = c0 ^ (c2 &^ c1)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
a[11] = c1 ^ (c3 &^ c2)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
a[12] = c2 ^ (c4 &^ c3)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
a[13] = c3 ^ (c0 &^ c4)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
a[14] = c4 ^ (c1 &^ c0)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-03 09:40:42 +00:00
|
|
|
// Rho / Pi
|
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
c0 = b40<<27 | b40>>37
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
c1 = b01<<36 | b01>>28
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
c2 = b12<<10 | b12>>54
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
c3 = b23<<15 | b23>>49
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
c4 = b34<<56 | b34>>8
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-03 09:40:42 +00:00
|
|
|
// Chi
|
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
a[15] = c0 ^ (c2 &^ c1)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
a[16] = c1 ^ (c3 &^ c2)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
a[17] = c2 ^ (c4 &^ c3)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
a[18] = c3 ^ (c0 &^ c4)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
a[19] = c4 ^ (c1 &^ c0)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-03 09:40:42 +00:00
|
|
|
// Rho / Pi
|
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
c0 = b20<<62 | b20>>2
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
c1 = b31<<55 | b31>>9
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
c2 = b42<<39 | b42>>25
|
2015-01-01 00:40:56 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
c3 = b03<<41 | b03>>23
|
2015-01-01 01:52:09 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
c4 = b14<<2 | b14>>62
|
2015-01-01 01:52:09 +00:00
|
|
|
|
2015-01-03 09:40:42 +00:00
|
|
|
// Chi
|
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
a[20] = c0 ^ (c2 &^ c1)
|
2015-01-01 01:52:09 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
a[21] = c1 ^ (c3 &^ c2)
|
2015-01-01 01:52:09 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
a[22] = c2 ^ (c4 &^ c3)
|
2015-01-01 01:52:09 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
a[23] = c3 ^ (c0 &^ c4)
|
2015-01-01 01:52:09 +00:00
|
|
|
|
2015-01-01 11:06:32 +00:00
|
|
|
a[24] = c4 ^ (c1 &^ c0)
|
2015-01-01 00:40:56 +00:00
|
|
|
|
|
|
|
}
|