You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2688 lines
72 KiB

package skein
import (
"encoding/binary"
"unsafe"
)
type CtxtHeader struct {
hashBitLen uint
bCnt uint
T [2]uint64
}
type Skein1024 struct {
h CtxtHeader
X [SKEIN1024_STATE_WORDS]uint64
b [SKEIN1024_BLOCK_BYTES]byte
}
func (s *Skein1024) Init(size uint) {
s.h.hashBitLen = size
switch size {
case 1024:
copy(s.X[:], SKEIN1024_IV_1024)
//TODO: prebuilds for other sizes.
default:
//Build the IV values
}
s.h.T[0] = 0
s.h.T[1] = (1 << 62) | (48 << 56)
s.h.bCnt=0
}
func (s *Skein1024) Update(msg []byte) {
n := uint(0)
if uint(len(msg)) + s.h.bCnt > SKEIN1024_BLOCK_BYTES {
if s.h.bCnt > 0 {
n = SKEIN1024_BLOCK_BYTES - s.h.bCnt
if n > 0 {
copy(s.b[s.h.bCnt:],msg)
msg = msg[n:]
s.h.bCnt += n
}
if s.h.bCnt != SKEIN1024_BLOCK_BYTES {
panic("ASSERTION FAILURE")
}
s.ProcessBlock(s.b[:],make([]uint64, SKEIN1024_STATE_WORDS+4), 1, SKEIN1024_BLOCK_BYTES)
s.h.bCnt = 0
}
if uint(len(msg)) > SKEIN1024_BLOCK_BYTES {
n = uint(len(msg) - 1) / SKEIN1024_BLOCK_BYTES
s.ProcessBlock(msg,make([]uint64, SKEIN1024_STATE_WORDS+4),n,SKEIN1024_BLOCK_BYTES)
msg = msg[n * SKEIN1024_BLOCK_BYTES:]
}
//ASSERT: ss.h.bCnt == 0
}
if len(msg) > 0 {
copy(s.b[s.h.bCnt:], msg)
s.h.bCnt += uint(len(msg))
}
}
func (s *Skein1024) Final(outp []byte) {
var n, byteCnt uint
X := make([]uint64, SKEIN1024_STATE_WORDS)
s.h.T[1] |= (1 << 63)
if s.h.bCnt < SKEIN1024_BLOCK_BYTES {
for j := s.h.bCnt; j < SKEIN1024_BLOCK_BYTES; j++ {
s.b[j] = 0
}
}
kw := make([]uint64, SKEIN1024_STATE_WORDS+4)
s.ProcessBlock(s.b[:],kw,1,s.h.bCnt)
byteCnt = (s.h.hashBitLen + 7) >> 3
for i, _ := range s.b {s.b[i] = 0}
copy(X, s.X[:])
for i := uint(0); i*SKEIN1024_BLOCK_BYTES < byteCnt; i++ {
binary.LittleEndian.PutUint64(s.b[:], uint64(i))
s.h.T[0] = 0
s.h.T[1] = (uint64(1) << 62 | uint64(63) << 56 | uint64(1) << 63)
s.h.bCnt=0
//ZERO OUT KW ARRAY
s.ProcessBlock(s.b[:],kw,1,8)
n = byteCnt - i*SKEIN1024_BLOCK_BYTES /* number of output bytes left to go */
if n >= SKEIN1024_BLOCK_BYTES {
n = SKEIN1024_BLOCK_BYTES
}
//copy(outp[i*SKEIN1024_BLOCK_BYTES:],s.X)
CopyInt64ToBytes(outp[i*SKEIN1024_BLOCK_BYTES:], s.X[:])
//Maybe unecessary?
//Skein_Show_Final(1024,&s.h,n,hashVal+i*SKEIN1024_BLOCK_BYTES)
copy(s.X[:],X)
}
}
func CopyInt64ToBytes(dest []byte, src []uint64) {
up := (*[]uint64)(unsafe.Pointer(&dest))
for i := 0; i < len(src); i++ {
(*up)[i] = src[i]
}
}
func CopyBytesToInt64(dest []uint64, src []byte) {
up := (*[]uint64)(unsafe.Pointer(&src))
for i := uint(0); i < uint(len(src) / 8); i++ {
dest[i] = (*up)[i]
}
}
func (s *Skein1024) ProcessBlock(blk []byte, kw []uint64, blkCnt, byteCntAdd uint) {
const WCNT = SKEIN1024_STATE_WORDS
//var kw [WCNT+4]uint6
var X00,X01,X02,X03,X04,X05,X06,X07,X08,X09,X10,X11,X12,X13,X14,X15 uint64
var w_ [WCNT]uint64
w := w_[:]
//w := make([]uint64, WCNT)
//ASSERT blkCnt != 0
ks := kw[3:]
kw[0] = s.h.T[0]
kw[1] = s.h.T[1]
/*
if blkCnt == 0 {
fmt.Println("Is this ever called?")
blkCnt++
}*/
for ;blkCnt > 0; blkCnt-- {
kw[0] += uint64(byteCntAdd)
ks[0] = s.X[0]
ks[1] = s.X[1]
ks[2] = s.X[2]
ks[3] = s.X[3]
ks[4] = s.X[4]
ks[5] = s.X[5]
ks[6] = s.X[6]
ks[7] = s.X[7]
ks[8] = s.X[8]
ks[9] = s.X[9]
ks[10] = s.X[10]
ks[11] = s.X[11]
ks[12] = s.X[12]
ks[13] = s.X[13]
ks[14] = s.X[14]
ks[15] = s.X[15]
ks[16] = ks[0] ^ ks[1] ^ ks[2] ^ ks[3] ^ ks[4] ^ ks[5] ^ ks[6] ^ ks[7] ^ ks[8] ^ ks[9] ^ ks[10] ^ ks[11] ^ ks[12] ^ ks[13] ^ ks[14] ^ ks[15] ^ ((0xA9FC1A22) + (( uint64(0x1BD11BDA)) << 32))
kw[2] = kw[0] ^ kw[1]
//copy(w[:], blk[:8*WCNT])
CopyBytesToInt64(w, blk)
X00 = w[ 0] + ks[ 0] /* do the first full key injection */
X01 = w[ 1] + ks[ 1]
X02 = w[ 2] + ks[ 2]
X03 = w[ 3] + ks[ 3]
X04 = w[ 4] + ks[ 4]
X05 = w[ 5] + ks[ 5]
X06 = w[ 6] + ks[ 6]
X07 = w[ 7] + ks[ 7]
X08 = w[ 8] + ks[ 8]
X09 = w[ 9] + ks[ 9]
X10 = w[10] + ks[10]
X11 = w[11] + ks[11]
X12 = w[12] + ks[12]
X13 = w[13] + ks[13] + kw[0]
X14 = w[14] + ks[14] + kw[1]
X15 = w[15] + ks[15]
ks[0] = s.X[0]
X00 += X01
X01 = (((X01) << (R1024_0_0)) | ((X01) >> (64-(R1024_0_0))))
X01 ^= X00
X02 += X03
X03 = (((X03) << (R1024_0_1)) | ((X03) >> (64-(R1024_0_1))))
X03 ^= X02
X04 += X05
X05 = (((X05) << (R1024_0_2)) | ((X05) >> (64-(R1024_0_2))))
X05 ^= X04
X06 += X07
X07 = (((X07) << (R1024_0_3)) | ((X07) >> (64-(R1024_0_3))))
X07 ^= X06
X08 += X09
X09 = (((X09) << (R1024_0_4)) | ((X09) >> (64-(R1024_0_4))))
X09 ^= X08
X10 += X11
X11 = (((X11) << (R1024_0_5)) | ((X11) >> (64-(R1024_0_5))))
X11 ^= X10
X12 += X13
X13 = (((X13) << (R1024_0_6)) | ((X13) >> (64-(R1024_0_6))))
X13 ^= X12
X14 += X15
X15 = (((X15) << (R1024_0_7)) | ((X15) >> (64-(R1024_0_7))))
X15 ^= X14
X00 += X09
X09 = (((X09) << (R1024_1_0)) | ((X09) >> (64-(R1024_1_0))))
X09 ^= X00
X02 += X13
X13 = (((X13) << (R1024_1_1)) | ((X13) >> (64-(R1024_1_1))))
X13 ^= X02
X06 += X11
X11 = (((X11) << (R1024_1_2)) | ((X11) >> (64-(R1024_1_2))))
X11 ^= X06
X04 += X15
X15 = (((X15) << (R1024_1_3)) | ((X15) >> (64-(R1024_1_3))))
X15 ^= X04
X10 += X07
X07 = (((X07) << (R1024_1_4)) | ((X07) >> (64-(R1024_1_4))))
X07 ^= X10
X12 += X03
X03 = (((X03) << (R1024_1_5)) | ((X03) >> (64-(R1024_1_5))))
X03 ^= X12
X14 += X05
X05 = (((X05) << (R1024_1_6)) | ((X05) >> (64-(R1024_1_6))))
X05 ^= X14
X08 += X01
X01 = (((X01) << (R1024_1_7)) | ((X01) >> (64-(R1024_1_7))))
X01 ^= X08
X00 += X07
X07 = (((X07) << (R1024_2_0)) | ((X07) >> (64-(R1024_2_0))))
X07 ^= X00
X02 += X05
X05 = (((X05) << (R1024_2_1)) | ((X05) >> (64-(R1024_2_1))))
X05 ^= X02
X04 += X03
X03 = (((X03) << (R1024_2_2)) | ((X03) >> (64-(R1024_2_2))))
X03 ^= X04
X06 += X01
X01 = (((X01) << (R1024_2_3)) | ((X01) >> (64-(R1024_2_3))))
X01 ^= X06
X12 += X15
X15 = (((X15) << (R1024_2_4)) | ((X15) >> (64-(R1024_2_4))))
X15 ^= X12
X14 += X13
X13 = (((X13) << (R1024_2_5)) | ((X13) >> (64-(R1024_2_5))))
X13 ^= X14
X08 += X11
X11 = (((X11) << (R1024_2_6)) | ((X11) >> (64-(R1024_2_6))))
X11 ^= X08
X10 += X09
X09 = (((X09) << (R1024_2_7)) | ((X09) >> (64-(R1024_2_7))))
X09 ^= X10
X00 += X15
X15 = (((X15) << (R1024_3_0)) | ((X15) >> (64-(R1024_3_0))))
X15 ^= X00
X02 += X11
X11 = (((X11) << (R1024_3_1)) | ((X11) >> (64-(R1024_3_1))))
X11 ^= X02
X06 += X13
X13 = (((X13) << (R1024_3_2)) | ((X13) >> (64-(R1024_3_2))))
X13 ^= X06
X04 += X09
X09 = (((X09) << (R1024_3_3)) | ((X09) >> (64-(R1024_3_3))))
X09 ^= X04
X14 += X01
X01 = (((X01) << (R1024_3_4)) | ((X01) >> (64-(R1024_3_4))))
X01 ^= X14
X08 += X05
X05 = (((X05) << (R1024_3_5)) | ((X05) >> (64-(R1024_3_5))))
X05 ^= X08
X10 += X03
X03 = (((X03) << (R1024_3_6)) | ((X03) >> (64-(R1024_3_6))))
X03 ^= X10
X12 += X07
X07 = (((X07) << (R1024_3_7)) | ((X07) >> (64-(R1024_3_7))))
X07 ^= X12
X00 += ks[((2*(0))+ 1) % 17]
X01 += ks[((2*(0))+ 2) % 17]
X02 += ks[((2*(0))+ 3) % 17]
X03 += ks[((2*(0))+ 4) % 17]
X04 += ks[((2*(0))+ 5) % 17]
X05 += ks[((2*(0))+ 6) % 17]
X06 += ks[((2*(0))+ 7) % 17]
X07 += ks[((2*(0))+ 8) % 17]
X08 += ks[((2*(0))+ 9) % 17]
X09 += ks[((2*(0))+10) % 17]
X10 += ks[((2*(0))+11) % 17]
X11 += ks[((2*(0))+12) % 17]
X12 += ks[((2*(0))+13) % 17]
X13 += ks[((2*(0))+14) % 17] + kw[((2*(0))+1) % 3]
X14 += ks[((2*(0))+15) % 17] + kw[((2*(0))+2) % 3]
X15 += ks[((2*(0))+16) % 17] + (2*(0))+1
X00 += X01
X01 = (((X01) << (R1024_4_0)) | ((X01) >> (64-(R1024_4_0))))
X01 ^= X00
X02 += X03
X03 = (((X03) << (R1024_4_1)) | ((X03) >> (64-(R1024_4_1))))
X03 ^= X02
X04 += X05
X05 = (((X05) << (R1024_4_2)) | ((X05) >> (64-(R1024_4_2))))
X05 ^= X04
X06 += X07
X07 = (((X07) << (R1024_4_3)) | ((X07) >> (64-(R1024_4_3))))
X07 ^= X06
X08 += X09
X09 = (((X09) << (R1024_4_4)) | ((X09) >> (64-(R1024_4_4))))
X09 ^= X08
X10 += X11
X11 = (((X11) << (R1024_4_5)) | ((X11) >> (64-(R1024_4_5))))
X11 ^= X10
X12 += X13
X13 = (((X13) << (R1024_4_6)) | ((X13) >> (64-(R1024_4_6))))
X13 ^= X12
X14 += X15
X15 = (((X15) << (R1024_4_7)) | ((X15) >> (64-(R1024_4_7))))
X15 ^= X14
X00 += X09
X09 = (((X09) << (R1024_5_0)) | ((X09) >> (64-(R1024_5_0))))
X09 ^= X00
X02 += X13
X13 = (((X13) << (R1024_5_1)) | ((X13) >> (64-(R1024_5_1))))
X13 ^= X02
X06 += X11
X11 = (((X11) << (R1024_5_2)) | ((X11) >> (64-(R1024_5_2))))
X11 ^= X06
X04 += X15
X15 = (((X15) << (R1024_5_3)) | ((X15) >> (64-(R1024_5_3))))
X15 ^= X04
X10 += X07
X07 = (((X07) << (R1024_5_4)) | ((X07) >> (64-(R1024_5_4))))
X07 ^= X10
X12 += X03
X03 = (((X03) << (R1024_5_5)) | ((X03) >> (64-(R1024_5_5))))
X03 ^= X12
X14 += X05
X05 = (((X05) << (R1024_5_6)) | ((X05) >> (64-(R1024_5_6))))
X05 ^= X14
X08 += X01
X01 = (((X01) << (R1024_5_7)) | ((X01) >> (64-(R1024_5_7))))
X01 ^= X08
X00 += X07
X07 = (((X07) << (R1024_6_0)) | ((X07) >> (64-(R1024_6_0))))
X07 ^= X00
X02 += X05
X05 = (((X05) << (R1024_6_1)) | ((X05) >> (64-(R1024_6_1))))
X05 ^= X02
X04 += X03
X03 = (((X03) << (R1024_6_2)) | ((X03) >> (64-(R1024_6_2))))
X03 ^= X04
X06 += X01
X01 = (((X01) << (R1024_6_3)) | ((X01) >> (64-(R1024_6_3))))
X01 ^= X06
X12 += X15
X15 = (((X15) << (R1024_6_4)) | ((X15) >> (64-(R1024_6_4))))
X15 ^= X12
X14 += X13
X13 = (((X13) << (R1024_6_5)) | ((X13) >> (64-(R1024_6_5))))
X13 ^= X14
X08 += X11
X11 = (((X11) << (R1024_6_6)) | ((X11) >> (64-(R1024_6_6))))
X11 ^= X08
X10 += X09
X09 = (((X09) << (R1024_6_7)) | ((X09) >> (64-(R1024_6_7))))
X09 ^= X10
X00 += X15
X15 = (((X15) << (R1024_7_0)) | ((X15) >> (64-(R1024_7_0))))
X15 ^= X00
X02 += X11
X11 = (((X11) << (R1024_7_1)) | ((X11) >> (64-(R1024_7_1))))
X11 ^= X02
X06 += X13
X13 = (((X13) << (R1024_7_2)) | ((X13) >> (64-(R1024_7_2))))
X13 ^= X06
X04 += X09
X09 = (((X09) << (R1024_7_3)) | ((X09) >> (64-(R1024_7_3))))
X09 ^= X04
X14 += X01
X01 = (((X01) << (R1024_7_4)) | ((X01) >> (64-(R1024_7_4))))
X01 ^= X14
X08 += X05
X05 = (((X05) << (R1024_7_5)) | ((X05) >> (64-(R1024_7_5))))
X05 ^= X08
X10 += X03
X03 = (((X03) << (R1024_7_6)) | ((X03) >> (64-(R1024_7_6))))
X03 ^= X10
X12 += X07
X07 = (((X07) << (R1024_7_7)) | ((X07) >> (64-(R1024_7_7))))
X07 ^= X12
X00 += ks[((2*(0)+1)+ 1) % 17]
X01 += ks[((2*(0)+1)+ 2) % 17]
X02 += ks[((2*(0)+1)+ 3) % 17]
X03 += ks[((2*(0)+1)+ 4) % 17]
X04 += ks[((2*(0)+1)+ 5) % 17]
X05 += ks[((2*(0)+1)+ 6) % 17]
X06 += ks[((2*(0)+1)+ 7) % 17]
X07 += ks[((2*(0)+1)+ 8) % 17]
X08 += ks[((2*(0)+1)+ 9) % 17]
X09 += ks[((2*(0)+1)+10) % 17]
X10 += ks[((2*(0)+1)+11) % 17]
X11 += ks[((2*(0)+1)+12) % 17]
X12 += ks[((2*(0)+1)+13) % 17]
X13 += ks[((2*(0)+1)+14) % 17] + kw[((2*(0)+1)+1) % 3]
X14 += ks[((2*(0)+1)+15) % 17] + kw[((2*(0)+1)+2) % 3]
X15 += ks[((2*(0)+1)+16) % 17] + (2*(0)+1)+1
X00 += X01
X01 = (((X01) << (R1024_0_0)) | ((X01) >> (64-(R1024_0_0))))
X01 ^= X00
X02 += X03
X03 = (((X03) << (R1024_0_1)) | ((X03) >> (64-(R1024_0_1))))
X03 ^= X02
X04 += X05
X05 = (((X05) << (R1024_0_2)) | ((X05) >> (64-(R1024_0_2))))
X05 ^= X04
X06 += X07
X07 = (((X07) << (R1024_0_3)) | ((X07) >> (64-(R1024_0_3))))
X07 ^= X06
X08 += X09
X09 = (((X09) << (R1024_0_4)) | ((X09) >> (64-(R1024_0_4))))
X09 ^= X08
X10 += X11
X11 = (((X11) << (R1024_0_5)) | ((X11) >> (64-(R1024_0_5))))
X11 ^= X10
X12 += X13
X13 = (((X13) << (R1024_0_6)) | ((X13) >> (64-(R1024_0_6))))
X13 ^= X12
X14 += X15
X15 = (((X15) << (R1024_0_7)) | ((X15) >> (64-(R1024_0_7))))
X15 ^= X14
X00 += X09
X09 = (((X09) << (R1024_1_0)) | ((X09) >> (64-(R1024_1_0))))
X09 ^= X00
X02 += X13
X13 = (((X13) << (R1024_1_1)) | ((X13) >> (64-(R1024_1_1))))
X13 ^= X02
X06 += X11
X11 = (((X11) << (R1024_1_2)) | ((X11) >> (64-(R1024_1_2))))
X11 ^= X06
X04 += X15
X15 = (((X15) << (R1024_1_3)) | ((X15) >> (64-(R1024_1_3))))
X15 ^= X04
X10 += X07
X07 = (((X07) << (R1024_1_4)) | ((X07) >> (64-(R1024_1_4))))
X07 ^= X10
X12 += X03
X03 = (((X03) << (R1024_1_5)) | ((X03) >> (64-(R1024_1_5))))
X03 ^= X12
X14 += X05
X05 = (((X05) << (R1024_1_6)) | ((X05) >> (64-(R1024_1_6))))
X05 ^= X14
X08 += X01
X01 = (((X01) << (R1024_1_7)) | ((X01) >> (64-(R1024_1_7))))
X01 ^= X08
X00 += X07
X07 = (((X07) << (R1024_2_0)) | ((X07) >> (64-(R1024_2_0))))
X07 ^= X00
X02 += X05
X05 = (((X05) << (R1024_2_1)) | ((X05) >> (64-(R1024_2_1))))
X05 ^= X02
X04 += X03
X03 = (((X03) << (R1024_2_2)) | ((X03) >> (64-(R1024_2_2))))
X03 ^= X04
X06 += X01
X01 = (((X01) << (R1024_2_3)) | ((X01) >> (64-(R1024_2_3))))
X01 ^= X06
X12 += X15
X15 = (((X15) << (R1024_2_4)) | ((X15) >> (64-(R1024_2_4))))
X15 ^= X12
X14 += X13
X13 = (((X13) << (R1024_2_5)) | ((X13) >> (64-(R1024_2_5))))
X13 ^= X14
X08 += X11
X11 = (((X11) << (R1024_2_6)) | ((X11) >> (64-(R1024_2_6))))
X11 ^= X08
X10 += X09
X09 = (((X09) << (R1024_2_7)) | ((X09) >> (64-(R1024_2_7))))
X09 ^= X10
X00 += X15
X15 = (((X15) << (R1024_3_0)) | ((X15) >> (64-(R1024_3_0))))
X15 ^= X00
X02 += X11
X11 = (((X11) << (R1024_3_1)) | ((X11) >> (64-(R1024_3_1))))
X11 ^= X02
X06 += X13
X13 = (((X13) << (R1024_3_2)) | ((X13) >> (64-(R1024_3_2))))
X13 ^= X06
X04 += X09
X09 = (((X09) << (R1024_3_3)) | ((X09) >> (64-(R1024_3_3))))
X09 ^= X04
X14 += X01
X01 = (((X01) << (R1024_3_4)) | ((X01) >> (64-(R1024_3_4))))
X01 ^= X14
X08 += X05
X05 = (((X05) << (R1024_3_5)) | ((X05) >> (64-(R1024_3_5))))
X05 ^= X08
X10 += X03
X03 = (((X03) << (R1024_3_6)) | ((X03) >> (64-(R1024_3_6))))
X03 ^= X10
X12 += X07
X07 = (((X07) << (R1024_3_7)) | ((X07) >> (64-(R1024_3_7))))
X07 ^= X12
X00 += ks[((2*(1))+ 1) % 17]
X01 += ks[((2*(1))+ 2) % 17]
X02 += ks[((2*(1))+ 3) % 17]
X03 += ks[((2*(1))+ 4) % 17]
X04 += ks[((2*(1))+ 5) % 17]
X05 += ks[((2*(1))+ 6) % 17]
X06 += ks[((2*(1))+ 7) % 17]
X07 += ks[((2*(1))+ 8) % 17]
X08 += ks[((2*(1))+ 9) % 17]
X09 += ks[((2*(1))+10) % 17]
X10 += ks[((2*(1))+11) % 17]
X11 += ks[((2*(1))+12) % 17]
X12 += ks[((2*(1))+13) % 17]
X13 += ks[((2*(1))+14) % 17] + kw[((2*(1))+1) % 3]
X14 += ks[((2*(1))+15) % 17] + kw[((2*(1))+2) % 3]
X15 += ks[((2*(1))+16) % 17] + (2*(1))+1
X00 += X01
X01 = (((X01) << (R1024_4_0)) | ((X01) >> (64-(R1024_4_0))))
X01 ^= X00
X02 += X03
X03 = (((X03) << (R1024_4_1)) | ((X03) >> (64-(R1024_4_1))))
X03 ^= X02
X04 += X05
X05 = (((X05) << (R1024_4_2)) | ((X05) >> (64-(R1024_4_2))))
X05 ^= X04
X06 += X07
X07 = (((X07) << (R1024_4_3)) | ((X07) >> (64-(R1024_4_3))))
X07 ^= X06
X08 += X09
X09 = (((X09) << (R1024_4_4)) | ((X09) >> (64-(R1024_4_4))))
X09 ^= X08
X10 += X11
X11 = (((X11) << (R1024_4_5)) | ((X11) >> (64-(R1024_4_5))))
X11 ^= X10
X12 += X13
X13 = (((X13) << (R1024_4_6)) | ((X13) >> (64-(R1024_4_6))))
X13 ^= X12
X14 += X15
X15 = (((X15) << (R1024_4_7)) | ((X15) >> (64-(R1024_4_7))))
X15 ^= X14
X00 += X09
X09 = (((X09) << (R1024_5_0)) | ((X09) >> (64-(R1024_5_0))))
X09 ^= X00
X02 += X13
X13 = (((X13) << (R1024_5_1)) | ((X13) >> (64-(R1024_5_1))))
X13 ^= X02
X06 += X11
X11 = (((X11) << (R1024_5_2)) | ((X11) >> (64-(R1024_5_2))))
X11 ^= X06
X04 += X15
X15 = (((X15) << (R1024_5_3)) | ((X15) >> (64-(R1024_5_3))))
X15 ^= X04
X10 += X07
X07 = (((X07) << (R1024_5_4)) | ((X07) >> (64-(R1024_5_4))))
X07 ^= X10
X12 += X03
X03 = (((X03) << (R1024_5_5)) | ((X03) >> (64-(R1024_5_5))))
X03 ^= X12
X14 += X05
X05 = (((X05) << (R1024_5_6)) | ((X05) >> (64-(R1024_5_6))))
X05 ^= X14
X08 += X01
X01 = (((X01) << (R1024_5_7)) | ((X01) >> (64-(R1024_5_7))))
X01 ^= X08
X00 += X07
X07 = (((X07) << (R1024_6_0)) | ((X07) >> (64-(R1024_6_0))))
X07 ^= X00
X02 += X05
X05 = (((X05) << (R1024_6_1)) | ((X05) >> (64-(R1024_6_1))))
X05 ^= X02
X04 += X03
X03 = (((X03) << (R1024_6_2)) | ((X03) >> (64-(R1024_6_2))))
X03 ^= X04
X06 += X01
X01 = (((X01) << (R1024_6_3)) | ((X01) >> (64-(R1024_6_3))))
X01 ^= X06
X12 += X15
X15 = (((X15) << (R1024_6_4)) | ((X15) >> (64-(R1024_6_4))))
X15 ^= X12
X14 += X13
X13 = (((X13) << (R1024_6_5)) | ((X13) >> (64-(R1024_6_5))))
X13 ^= X14
X08 += X11
X11 = (((X11) << (R1024_6_6)) | ((X11) >> (64-(R1024_6_6))))
X11 ^= X08
X10 += X09
X09 = (((X09) << (R1024_6_7)) | ((X09) >> (64-(R1024_6_7))))
X09 ^= X10
X00 += X15
X15 = (((X15) << (R1024_7_0)) | ((X15) >> (64-(R1024_7_0))))
X15 ^= X00
X02 += X11
X11 = (((X11) << (R1024_7_1)) | ((X11) >> (64-(R1024_7_1))))
X11 ^= X02
X06 += X13
X13 = (((X13) << (R1024_7_2)) | ((X13) >> (64-(R1024_7_2))))
X13 ^= X06
X04 += X09
X09 = (((X09) << (R1024_7_3)) | ((X09) >> (64-(R1024_7_3))))
X09 ^= X04
X14 += X01
X01 = (((X01) << (R1024_7_4)) | ((X01) >> (64-(R1024_7_4))))
X01 ^= X14
X08 += X05
X05 = (((X05) << (R1024_7_5)) | ((X05) >> (64-(R1024_7_5))))
X05 ^= X08
X10 += X03
X03 = (((X03) << (R1024_7_6)) | ((X03) >> (64-(R1024_7_6))))
X03 ^= X10
X12 += X07
X07 = (((X07) << (R1024_7_7)) | ((X07) >> (64-(R1024_7_7))))
X07 ^= X12
X00 += ks[((2*(1)+1)+ 1) % 17]
X01 += ks[((2*(1)+1)+ 2) % 17]
X02 += ks[((2*(1)+1)+ 3) % 17]
X03 += ks[((2*(1)+1)+ 4) % 17]
X04 += ks[((2*(1)+1)+ 5) % 17]
X05 += ks[((2*(1)+1)+ 6) % 17]
X06 += ks[((2*(1)+1)+ 7) % 17]
X07 += ks[((2*(1)+1)+ 8) % 17]
X08 += ks[((2*(1)+1)+ 9) % 17]
X09 += ks[((2*(1)+1)+10) % 17]
X10 += ks[((2*(1)+1)+11) % 17]
X11 += ks[((2*(1)+1)+12) % 17]
X12 += ks[((2*(1)+1)+13) % 17]
X13 += ks[((2*(1)+1)+14) % 17] + kw[((2*(1)+1)+1) % 3]
X14 += ks[((2*(1)+1)+15) % 17] + kw[((2*(1)+1)+2) % 3]
X15 += ks[((2*(1)+1)+16) % 17] + (2*(1)+1)+1
X00 += X01
X01 = (((X01) << (R1024_0_0)) | ((X01) >> (64-(R1024_0_0))))
X01 ^= X00
X02 += X03
X03 = (((X03) << (R1024_0_1)) | ((X03) >> (64-(R1024_0_1))))
X03 ^= X02
X04 += X05
X05 = (((X05) << (R1024_0_2)) | ((X05) >> (64-(R1024_0_2))))
X05 ^= X04
X06 += X07
X07 = (((X07) << (R1024_0_3)) | ((X07) >> (64-(R1024_0_3))))
X07 ^= X06
X08 += X09
X09 = (((X09) << (R1024_0_4)) | ((X09) >> (64-(R1024_0_4))))
X09 ^= X08
X10 += X11
X11 = (((X11) << (R1024_0_5)) | ((X11) >> (64-(R1024_0_5))))
X11 ^= X10
X12 += X13
X13 = (((X13) << (R1024_0_6)) | ((X13) >> (64-(R1024_0_6))))
X13 ^= X12
X14 += X15
X15 = (((X15) << (R1024_0_7)) | ((X15) >> (64-(R1024_0_7))))
X15 ^= X14
X00 += X09
X09 = (((X09) << (R1024_1_0)) | ((X09) >> (64-(R1024_1_0))))
X09 ^= X00
X02 += X13
X13 = (((X13) << (R1024_1_1)) | ((X13) >> (64-(R1024_1_1))))
X13 ^= X02
X06 += X11
X11 = (((X11) << (R1024_1_2)) | ((X11) >> (64-(R1024_1_2))))
X11 ^= X06
X04 += X15
X15 = (((X15) << (R1024_1_3)) | ((X15) >> (64-(R1024_1_3))))
X15 ^= X04
X10 += X07
X07 = (((X07) << (R1024_1_4)) | ((X07) >> (64-(R1024_1_4))))
X07 ^= X10
X12 += X03
X03 = (((X03) << (R1024_1_5)) | ((X03) >> (64-(R1024_1_5))))
X03 ^= X12
X14 += X05
X05 = (((X05) << (R1024_1_6)) | ((X05) >> (64-(R1024_1_6))))
X05 ^= X14
X08 += X01
X01 = (((X01) << (R1024_1_7)) | ((X01) >> (64-(R1024_1_7))))
X01 ^= X08
X00 += X07
X07 = (((X07) << (R1024_2_0)) | ((X07) >> (64-(R1024_2_0))))
X07 ^= X00
X02 += X05
X05 = (((X05) << (R1024_2_1)) | ((X05) >> (64-(R1024_2_1))))
X05 ^= X02
X04 += X03
X03 = (((X03) << (R1024_2_2)) | ((X03) >> (64-(R1024_2_2))))
X03 ^= X04
X06 += X01
X01 = (((X01) << (R1024_2_3)) | ((X01) >> (64-(R1024_2_3))))
X01 ^= X06
X12 += X15
X15 = (((X15) << (R1024_2_4)) | ((X15) >> (64-(R1024_2_4))))
X15 ^= X12
X14 += X13
X13 = (((X13) << (R1024_2_5)) | ((X13) >> (64-(R1024_2_5))))
X13 ^= X14
X08 += X11
X11 = (((X11) << (R1024_2_6)) | ((X11) >> (64-(R1024_2_6))))
X11 ^= X08
X10 += X09
X09 = (((X09) << (R1024_2_7)) | ((X09) >> (64-(R1024_2_7))))
X09 ^= X10
X00 += X15
X15 = (((X15) << (R1024_3_0)) | ((X15) >> (64-(R1024_3_0))))
X15 ^= X00
X02 += X11
X11 = (((X11) << (R1024_3_1)) | ((X11) >> (64-(R1024_3_1))))
X11 ^= X02
X06 += X13
X13 = (((X13) << (R1024_3_2)) | ((X13) >> (64-(R1024_3_2))))
X13 ^= X06
X04 += X09
X09 = (((X09) << (R1024_3_3)) | ((X09) >> (64-(R1024_3_3))))
X09 ^= X04
X14 += X01
X01 = (((X01) << (R1024_3_4)) | ((X01) >> (64-(R1024_3_4))))
X01 ^= X14
X08 += X05
X05 = (((X05) << (R1024_3_5)) | ((X05) >> (64-(R1024_3_5))))
X05 ^= X08
X10 += X03
X03 = (((X03) << (R1024_3_6)) | ((X03) >> (64-(R1024_3_6))))
X03 ^= X10
X12 += X07
X07 = (((X07) << (R1024_3_7)) | ((X07) >> (64-(R1024_3_7))))
X07 ^= X12
X00 += ks[((2*(2))+ 1) % 17]
X01 += ks[((2*(2))+ 2) % 17]
X02 += ks[((2*(2))+ 3) % 17]
X03 += ks[((2*(2))+ 4) % 17]
X04 += ks[((2*(2))+ 5) % 17]
X05 += ks[((2*(2))+ 6) % 17]
X06 += ks[((2*(2))+ 7) % 17]
X07 += ks[((2*(2))+ 8) % 17]
X08 += ks[((2*(2))+ 9) % 17]
X09 += ks[((2*(2))+10) % 17]
X10 += ks[((2*(2))+11) % 17]
X11 += ks[((2*(2))+12) % 17]
X12 += ks[((2*(2))+13) % 17]
X13 += ks[((2*(2))+14) % 17] + kw[((2*(2))+1) % 3]
X14 += ks[((2*(2))+15) % 17] + kw[((2*(2))+2) % 3]
X15 += ks[((2*(2))+16) % 17] + (2*(2))+1
X00 += X01
X01 = (((X01) << (R1024_4_0)) | ((X01) >> (64-(R1024_4_0))))
X01 ^= X00
X02 += X03
X03 = (((X03) << (R1024_4_1)) | ((X03) >> (64-(R1024_4_1))))
X03 ^= X02
X04 += X05
X05 = (((X05) << (R1024_4_2)) | ((X05) >> (64-(R1024_4_2))))
X05 ^= X04
X06 += X07
X07 = (((X07) << (R1024_4_3)) | ((X07) >> (64-(R1024_4_3))))
X07 ^= X06
X08 += X09
X09 = (((X09) << (R1024_4_4)) | ((X09) >> (64-(R1024_4_4))))
X09 ^= X08
X10 += X11
X11 = (((X11) << (R1024_4_5)) | ((X11) >> (64-(R1024_4_5))))
X11 ^= X10
X12 += X13
X13 = (((X13) << (R1024_4_6)) | ((X13) >> (64-(R1024_4_6))))
X13 ^= X12
X14 += X15
X15 = (((X15) << (R1024_4_7)) | ((X15) >> (64-(R1024_4_7))))
X15 ^= X14
X00 += X09
X09 = (((X09) << (R1024_5_0)) | ((X09) >> (64-(R1024_5_0))))
X09 ^= X00
X02 += X13
X13 = (((X13) << (R1024_5_1)) | ((X13) >> (64-(R1024_5_1))))
X13 ^= X02
X06 += X11
X11 = (((X11) << (R1024_5_2)) | ((X11) >> (64-(R1024_5_2))))
X11 ^= X06
X04 += X15
X15 = (((X15) << (R1024_5_3)) | ((X15) >> (64-(R1024_5_3))))
X15 ^= X04
X10 += X07
X07 = (((X07) << (R1024_5_4)) | ((X07) >> (64-(R1024_5_4))))
X07 ^= X10
X12 += X03
X03 = (((X03) << (R1024_5_5)) | ((X03) >> (64-(R1024_5_5))))
X03 ^= X12
X14 += X05
X05 = (((X05) << (R1024_5_6)) | ((X05) >> (64-(R1024_5_6))))
X05 ^= X14
X08 += X01
X01 = (((X01) << (R1024_5_7)) | ((X01) >> (64-(R1024_5_7))))
X01 ^= X08
X00 += X07
X07 = (((X07) << (R1024_6_0)) | ((X07) >> (64-(R1024_6_0))))
X07 ^= X00
X02 += X05
X05 = (((X05) << (R1024_6_1)) | ((X05) >> (64-(R1024_6_1))))
X05 ^= X02
X04 += X03
X03 = (((X03) << (R1024_6_2)) | ((X03) >> (64-(R1024_6_2))))
X03 ^= X04
X06 += X01
X01 = (((X01) << (R1024_6_3)) | ((X01) >> (64-(R1024_6_3))))
X01 ^= X06
X12 += X15
X15 = (((X15) << (R1024_6_4)) | ((X15) >> (64-(R1024_6_4))))
X15 ^= X12
X14 += X13
X13 = (((X13) << (R1024_6_5)) | ((X13) >> (64-(R1024_6_5))))
X13 ^= X14
X08 += X11
X11 = (((X11) << (R1024_6_6)) | ((X11) >> (64-(R1024_6_6))))
X11 ^= X08
X10 += X09
X09 = (((X09) << (R1024_6_7)) | ((X09) >> (64-(R1024_6_7))))
X09 ^= X10
X00 += X15
X15 = (((X15) << (R1024_7_0)) | ((X15) >> (64-(R1024_7_0))))
X15 ^= X00
X02 += X11
X11 = (((X11) << (R1024_7_1)) | ((X11) >> (64-(R1024_7_1))))
X11 ^= X02
X06 += X13
X13 = (((X13) << (R1024_7_2)) | ((X13) >> (64-(R1024_7_2))))
X13 ^= X06
X04 += X09
X09 = (((X09) << (R1024_7_3)) | ((X09) >> (64-(R1024_7_3))))
X09 ^= X04
X14 += X01
X01 = (((X01) << (R1024_7_4)) | ((X01) >> (64-(R1024_7_4))))
X01 ^= X14
X08 += X05
X05 = (((X05) << (R1024_7_5)) | ((X05) >> (64-(R1024_7_5))))
X05 ^= X08
X10 += X03
X03 = (((X03) << (R1024_7_6)) | ((X03) >> (64-(R1024_7_6))))
X03 ^= X10
X12 += X07
X07 = (((X07) << (R1024_7_7)) | ((X07) >> (64-(R1024_7_7))))
X07 ^= X12
X00 += ks[((2*(2)+1)+ 1) % 17]
X01 += ks[((2*(2)+1)+ 2) % 17]
X02 += ks[((2*(2)+1)+ 3) % 17]
X03 += ks[((2*(2)+1)+ 4) % 17]
X04 += ks[((2*(2)+1)+ 5) % 17]
X05 += ks[((2*(2)+1)+ 6) % 17]
X06 += ks[((2*(2)+1)+ 7) % 17]
X07 += ks[((2*(2)+1)+ 8) % 17]
X08 += ks[((2*(2)+1)+ 9) % 17]
X09 += ks[((2*(2)+1)+10) % 17]
X10 += ks[((2*(2)+1)+11) % 17]
X11 += ks[((2*(2)+1)+12) % 17]
X12 += ks[((2*(2)+1)+13) % 17]
X13 += ks[((2*(2)+1)+14) % 17] + kw[((2*(2)+1)+1) % 3]
X14 += ks[((2*(2)+1)+15) % 17] + kw[((2*(2)+1)+2) % 3]
X15 += ks[((2*(2)+1)+16) % 17] + (2*(2)+1)+1
X00 += X01
X01 = (((X01) << (R1024_0_0)) | ((X01) >> (64-(R1024_0_0))))
X01 ^= X00
X02 += X03
X03 = (((X03) << (R1024_0_1)) | ((X03) >> (64-(R1024_0_1))))
X03 ^= X02
X04 += X05
X05 = (((X05) << (R1024_0_2)) | ((X05) >> (64-(R1024_0_2))))
X05 ^= X04
X06 += X07
X07 = (((X07) << (R1024_0_3)) | ((X07) >> (64-(R1024_0_3))))
X07 ^= X06
X08 += X09
X09 = (((X09) << (R1024_0_4)) | ((X09) >> (64-(R1024_0_4))))
X09 ^= X08
X10 += X11
X11 = (((X11) << (R1024_0_5)) | ((X11) >> (64-(R1024_0_5))))
X11 ^= X10
X12 += X13
X13 = (((X13) << (R1024_0_6)) | ((X13) >> (64-(R1024_0_6))))
X13 ^= X12
X14 += X15
X15 = (((X15) << (R1024_0_7)) | ((X15) >> (64-(R1024_0_7))))
X15 ^= X14
X00 += X09
X09 = (((X09) << (R1024_1_0)) | ((X09) >> (64-(R1024_1_0))))
X09 ^= X00
X02 += X13
X13 = (((X13) << (R1024_1_1)) | ((X13) >> (64-(R1024_1_1))))
X13 ^= X02
X06 += X11
X11 = (((X11) << (R1024_1_2)) | ((X11) >> (64-(R1024_1_2))))
X11 ^= X06
X04 += X15
X15 = (((X15) << (R1024_1_3)) | ((X15) >> (64-(R1024_1_3))))
X15 ^= X04
X10 += X07
X07 = (((X07) << (R1024_1_4)) | ((X07) >> (64-(R1024_1_4))))
X07 ^= X10
X12 += X03
X03 = (((X03) << (R1024_1_5)) | ((X03) >> (64-(R1024_1_5))))
X03 ^= X12
X14 += X05
X05 = (((X05) << (R1024_1_6)) | ((X05) >> (64-(R1024_1_6))))
X05 ^= X14
X08 += X01
X01 = (((X01) << (R1024_1_7)) | ((X01) >> (64-(R1024_1_7))))
X01 ^= X08
X00 += X07
X07 = (((X07) << (R1024_2_0)) | ((X07) >> (64-(R1024_2_0))))
X07 ^= X00
X02 += X05
X05 = (((X05) << (R1024_2_1)) | ((X05) >> (64-(R1024_2_1))))
X05 ^= X02
X04 += X03
X03 = (((X03) << (R1024_2_2)) | ((X03) >> (64-(R1024_2_2))))
X03 ^= X04
X06 += X01
X01 = (((X01) << (R1024_2_3)) | ((X01) >> (64-(R1024_2_3))))
X01 ^= X06
X12 += X15
X15 = (((X15) << (R1024_2_4)) | ((X15) >> (64-(R1024_2_4))))
X15 ^= X12
X14 += X13
X13 = (((X13) << (R1024_2_5)) | ((X13) >> (64-(R1024_2_5))))
X13 ^= X14
X08 += X11
X11 = (((X11) << (R1024_2_6)) | ((X11) >> (64-(R1024_2_6))))
X11 ^= X08
X10 += X09
X09 = (((X09) << (R1024_2_7)) | ((X09) >> (64-(R1024_2_7))))
X09 ^= X10
X00 += X15
X15 = (((X15) << (R1024_3_0)) | ((X15) >> (64-(R1024_3_0))))
X15 ^= X00
X02 += X11
X11 = (((X11) << (R1024_3_1)) | ((X11) >> (64-(R1024_3_1))))
X11 ^= X02
X06 += X13
X13 = (((X13) << (R1024_3_2)) | ((X13) >> (64-(R1024_3_2))))
X13 ^= X06
X04 += X09
X09 = (((X09) << (R1024_3_3)) | ((X09) >> (64-(R1024_3_3))))
X09 ^= X04
X14 += X01
X01 = (((X01) << (R1024_3_4)) | ((X01) >> (64-(R1024_3_4))))
X01 ^= X14
X08 += X05
X05 = (((X05) << (R1024_3_5)) | ((X05) >> (64-(R1024_3_5))))
X05 ^= X08
X10 += X03
X03 = (((X03) << (R1024_3_6)) | ((X03) >> (64-(R1024_3_6))))
X03 ^= X10
X12 += X07
X07 = (((X07) << (R1024_3_7)) | ((X07) >> (64-(R1024_3_7))))
X07 ^= X12
X00 += ks[((2*(3))+ 1) % 17]
X01 += ks[((2*(3))+ 2) % 17]
X02 += ks[((2*(3))+ 3) % 17]
X03 += ks[((2*(3))+ 4) % 17]
X04 += ks[((2*(3))+ 5) % 17]
X05 += ks[((2*(3))+ 6) % 17]
X06 += ks[((2*(3))+ 7) % 17]
X07 += ks[((2*(3))+ 8) % 17]
X08 += ks[((2*(3))+ 9) % 17]
X09 += ks[((2*(3))+10) % 17]
X10 += ks[((2*(3))+11) % 17]
X11 += ks[((2*(3))+12) % 17]
X12 += ks[((2*(3))+13) % 17]
X13 += ks[((2*(3))+14) % 17] + kw[((2*(3))+1) % 3]
X14 += ks[((2*(3))+15) % 17] + kw[((2*(3))+2) % 3]
X15 += ks[((2*(3))+16) % 17] + (2*(3))+1
X00 += X01
X01 = (((X01) << (R1024_4_0)) | ((X01) >> (64-(R1024_4_0))))
X01 ^= X00
X02 += X03
X03 = (((X03) << (R1024_4_1)) | ((X03) >> (64-(R1024_4_1))))
X03 ^= X02
X04 += X05
X05 = (((X05) << (R1024_4_2)) | ((X05) >> (64-(R1024_4_2))))
X05 ^= X04
X06 += X07
X07 = (((X07) << (R1024_4_3)) | ((X07) >> (64-(R1024_4_3))))
X07 ^= X06
X08 += X09
X09 = (((X09) << (R1024_4_4)) | ((X09) >> (64-(R1024_4_4))))
X09 ^= X08
X10 += X11
X11 = (((X11) << (R1024_4_5)) | ((X11) >> (64-(R1024_4_5))))
X11 ^= X10
X12 += X13
X13 = (((X13) << (R1024_4_6)) | ((X13) >> (64-(R1024_4_6))))
X13 ^= X12
X14 += X15
X15 = (((X15) << (R1024_4_7)) | ((X15) >> (64-(R1024_4_7))))
X15 ^= X14
X00 += X09
X09 = (((X09) << (R1024_5_0)) | ((X09) >> (64-(R1024_5_0))))
X09 ^= X00
X02 += X13
X13 = (((X13) << (R1024_5_1)) | ((X13) >> (64-(R1024_5_1))))
X13 ^= X02
X06 += X11
X11 = (((X11) << (R1024_5_2)) | ((X11) >> (64-(R1024_5_2))))
X11 ^= X06
X04 += X15
X15 = (((X15) << (R1024_5_3)) | ((X15) >> (64-(R1024_5_3))))
X15 ^= X04
X10 += X07
X07 = (((X07) << (R1024_5_4)) | ((X07) >> (64-(R1024_5_4))))
X07 ^= X10
X12 += X03
X03 = (((X03) << (R1024_5_5)) | ((X03) >> (64-(R1024_5_5))))
X03 ^= X12
X14 += X05
X05 = (((X05) << (R1024_5_6)) | ((X05) >> (64-(R1024_5_6))))
X05 ^= X14
X08 += X01
X01 = (((X01) << (R1024_5_7)) | ((X01) >> (64-(R1024_5_7))))
X01 ^= X08
X00 += X07
X07 = (((X07) << (R1024_6_0)) | ((X07) >> (64-(R1024_6_0))))
X07 ^= X00
X02 += X05
X05 = (((X05) << (R1024_6_1)) | ((X05) >> (64-(R1024_6_1))))
X05 ^= X02
X04 += X03
X03 = (((X03) << (R1024_6_2)) | ((X03) >> (64-(R1024_6_2))))
X03 ^= X04
X06 += X01
X01 = (((X01) << (R1024_6_3)) | ((X01) >> (64-(R1024_6_3))))
X01 ^= X06
X12 += X15
X15 = (((X15) << (R1024_6_4)) | ((X15) >> (64-(R1024_6_4))))
X15 ^= X12
X14 += X13
X13 = (((X13) << (R1024_6_5)) | ((X13) >> (64-(R1024_6_5))))
X13 ^= X14
X08 += X11
X11 = (((X11) << (R1024_6_6)) | ((X11) >> (64-(R1024_6_6))))
X11 ^= X08
X10 += X09
X09 = (((X09) << (R1024_6_7)) | ((X09) >> (64-(R1024_6_7))))
X09 ^= X10
X00 += X15
X15 = (((X15) << (R1024_7_0)) | ((X15) >> (64-(R1024_7_0))))
X15 ^= X00
X02 += X11
X11 = (((X11) << (R1024_7_1)) | ((X11) >> (64-(R1024_7_1))))
X11 ^= X02
X06 += X13
X13 = (((X13) << (R1024_7_2)) | ((X13) >> (64-(R1024_7_2))))
X13 ^= X06
X04 += X09
X09 = (((X09) << (R1024_7_3)) | ((X09) >> (64-(R1024_7_3))))
X09 ^= X04
X14 += X01
X01 = (((X01) << (R1024_7_4)) | ((X01) >> (64-(R1024_7_4))))
X01 ^= X14
X08 += X05
X05 = (((X05) << (R1024_7_5)) | ((X05) >> (64-(R1024_7_5))))
X05 ^= X08
X10 += X03
X03 = (((X03) << (R1024_7_6)) | ((X03) >> (64-(R1024_7_6))))
X03 ^= X10
X12 += X07
X07 = (((X07) << (R1024_7_7)) | ((X07) >> (64-(R1024_7_7))))
X07 ^= X12
X00 += ks[((2*(3)+1)+ 1) % 17]
X01 += ks[((2*(3)+1)+ 2) % 17]
X02 += ks[((2*(3)+1)+ 3) % 17]
X03 += ks[((2*(3)+1)+ 4) % 17]
X04 += ks[((2*(3)+1)+ 5) % 17]
X05 += ks[((2*(3)+1)+ 6) % 17]
X06 += ks[((2*(3)+1)+ 7) % 17]
X07 += ks[((2*(3)+1)+ 8) % 17]
X08 += ks[((2*(3)+1)+ 9) % 17]
X09 += ks[((2*(3)+1)+10) % 17]
X10 += ks[((2*(3)+1)+11) % 17]
X11 += ks[((2*(3)+1)+12) % 17]
X12 += ks[((2*(3)+1)+13) % 17]
X13 += ks[((2*(3)+1)+14) % 17] + kw[((2*(3)+1)+1) % 3]
X14 += ks[((2*(3)+1)+15) % 17] + kw[((2*(3)+1)+2) % 3]
X15 += ks[((2*(3)+1)+16) % 17] + (2*(3)+1)+1
X00 += X01
X01 = (((X01) << (R1024_0_0)) | ((X01) >> (64-(R1024_0_0))))
X01 ^= X00
X02 += X03
X03 = (((X03) << (R1024_0_1)) | ((X03) >> (64-(R1024_0_1))))
X03 ^= X02
X04 += X05
X05 = (((X05) << (R1024_0_2)) | ((X05) >> (64-(R1024_0_2))))
X05 ^= X04
X06 += X07
X07 = (((X07) << (R1024_0_3)) | ((X07) >> (64-(R1024_0_3))))
X07 ^= X06
X08 += X09
X09 = (((X09) << (R1024_0_4)) | ((X09) >> (64-(R1024_0_4))))
X09 ^= X08
X10 += X11
X11 = (((X11) << (R1024_0_5)) | ((X11) >> (64-(R1024_0_5))))
X11 ^= X10
X12 += X13
X13 = (((X13) << (R1024_0_6)) | ((X13) >> (64-(R1024_0_6))))
X13 ^= X12
X14 += X15
X15 = (((X15) << (R1024_0_7)) | ((X15) >> (64-(R1024_0_7))))
X15 ^= X14
X00 += X09
X09 = (((X09) << (R1024_1_0)) | ((X09) >> (64-(R1024_1_0))))
X09 ^= X00
X02 += X13
X13 = (((X13) << (R1024_1_1)) | ((X13) >> (64-(R1024_1_1))))
X13 ^= X02
X06 += X11
X11 = (((X11) << (R1024_1_2)) | ((X11) >> (64-(R1024_1_2))))
X11 ^= X06
X04 += X15
X15 = (((X15) << (R1024_1_3)) | ((X15) >> (64-(R1024_1_3))))
X15 ^= X04
X10 += X07
X07 = (((X07) << (R1024_1_4)) | ((X07) >> (64-(R1024_1_4))))
X07 ^= X10
X12 += X03
X03 = (((X03) << (R1024_1_5)) | ((X03) >> (64-(R1024_1_5))))
X03 ^= X12
X14 += X05
X05 = (((X05) << (R1024_1_6)) | ((X05) >> (64-(R1024_1_6))))
X05 ^= X14
X08 += X01
X01 = (((X01) << (R1024_1_7)) | ((X01) >> (64-(R1024_1_7))))
X01 ^= X08
X00 += X07
X07 = (((X07) << (R1024_2_0)) | ((X07) >> (64-(R1024_2_0))))
X07 ^= X00
X02 += X05
X05 = (((X05) << (R1024_2_1)) | ((X05) >> (64-(R1024_2_1))))
X05 ^= X02
X04 += X03
X03 = (((X03) << (R1024_2_2)) | ((X03) >> (64-(R1024_2_2))))
X03 ^= X04
X06 += X01
X01 = (((X01) << (R1024_2_3)) | ((X01) >> (64-(R1024_2_3))))
X01 ^= X06
X12 += X15
X15 = (((X15) << (R1024_2_4)) | ((X15) >> (64-(R1024_2_4))))
X15 ^= X12
X14 += X13
X13 = (((X13) << (R1024_2_5)) | ((X13) >> (64-(R1024_2_5))))
X13 ^= X14
X08 += X11
X11 = (((X11) << (R1024_2_6)) | ((X11) >> (64-(R1024_2_6))))
X11 ^= X08
X10 += X09
X09 = (((X09) << (R1024_2_7)) | ((X09) >> (64-(R1024_2_7))))
X09 ^= X10
X00 += X15
X15 = (((X15) << (R1024_3_0)) | ((X15) >> (64-(R1024_3_0))))
X15 ^= X00
X02 += X11
X11 = (((X11) << (R1024_3_1)) | ((X11) >> (64-(R1024_3_1))))
X11 ^= X02
X06 += X13
X13 = (((X13) << (R1024_3_2)) | ((X13) >> (64-(R1024_3_2))))
X13 ^= X06
X04 += X09
X09 = (((X09) << (R1024_3_3)) | ((X09) >> (64-(R1024_3_3))))
X09 ^= X04
X14 += X01
X01 = (((X01) << (R1024_3_4)) | ((X01) >> (64-(R1024_3_4))))
X01 ^= X14
X08 += X05
X05 = (((X05) << (R1024_3_5)) | ((X05) >> (64-(R1024_3_5))))
X05 ^= X08
X10 += X03
X03 = (((X03) << (R1024_3_6)) | ((X03) >> (64-(R1024_3_6))))
X03 ^= X10
X12 += X07
X07 = (((X07) << (R1024_3_7)) | ((X07) >> (64-(R1024_3_7))))
X07 ^= X12
X00 += ks[((2*(4))+ 1) % 17]
X01 += ks[((2*(4))+ 2) % 17]
X02 += ks[((2*(4))+ 3) % 17]
X03 += ks[((2*(4))+ 4) % 17]
X04 += ks[((2*(4))+ 5) % 17]
X05 += ks[((2*(4))+ 6) % 17]
X06 += ks[((2*(4))+ 7) % 17]
X07 += ks[((2*(4))+ 8) % 17]
X08 += ks[((2*(4))+ 9) % 17]
X09 += ks[((2*(4))+10) % 17]
X10 += ks[((2*(4))+11) % 17]
X11 += ks[((2*(4))+12) % 17]
X12 += ks[((2*(4))+13) % 17]
X13 += ks[((2*(4))+14) % 17] + kw[((2*(4))+1) % 3]
X14 += ks[((2*(4))+15) % 17] + kw[((2*(4))+2) % 3]
X15 += ks[((2*(4))+16) % 17] + (2*(4))+1
X00 += X01
X01 = (((X01) << (R1024_4_0)) | ((X01) >> (64-(R1024_4_0))))
X01 ^= X00
X02 += X03
X03 = (((X03) << (R1024_4_1)) | ((X03) >> (64-(R1024_4_1))))
X03 ^= X02
X04 += X05
X05 = (((X05) << (R1024_4_2)) | ((X05) >> (64-(R1024_4_2))))
X05 ^= X04
X06 += X07
X07 = (((X07) << (R1024_4_3)) | ((X07) >> (64-(R1024_4_3))))
X07 ^= X06
X08 += X09
X09 = (((X09) << (R1024_4_4)) | ((X09) >> (64-(R1024_4_4))))
X09 ^= X08
X10 += X11
X11 = (((X11) << (R1024_4_5)) | ((X11) >> (64-(R1024_4_5))))
X11 ^= X10
X12 += X13
X13 = (((X13) << (R1024_4_6)) | ((X13) >> (64-(R1024_4_6))))
X13 ^= X12
X14 += X15
X15 = (((X15) << (R1024_4_7)) | ((X15) >> (64-(R1024_4_7))))
X15 ^= X14
X00 += X09
X09 = (((X09) << (R1024_5_0)) | ((X09) >> (64-(R1024_5_0))))
X09 ^= X00
X02 += X13
X13 = (((X13) << (R1024_5_1)) | ((X13) >> (64-(R1024_5_1))))
X13 ^= X02
X06 += X11
X11 = (((X11) << (R1024_5_2)) | ((X11) >> (64-(R1024_5_2))))
X11 ^= X06
X04 += X15
X15 = (((X15) << (R1024_5_3)) | ((X15) >> (64-(R1024_5_3))))
X15 ^= X04
X10 += X07
X07 = (((X07) << (R1024_5_4)) | ((X07) >> (64-(R1024_5_4))))
X07 ^= X10
X12 += X03
X03 = (((X03) << (R1024_5_5)) | ((X03) >> (64-(R1024_5_5))))
X03 ^= X12
X14 += X05
X05 = (((X05) << (R1024_5_6)) | ((X05) >> (64-(R1024_5_6))))
X05 ^= X14
X08 += X01
X01 = (((X01) << (R1024_5_7)) | ((X01) >> (64-(R1024_5_7))))
X01 ^= X08
X00 += X07
X07 = (((X07) << (R1024_6_0)) | ((X07) >> (64-(R1024_6_0))))
X07 ^= X00
X02 += X05
X05 = (((X05) << (R1024_6_1)) | ((X05) >> (64-(R1024_6_1))))
X05 ^= X02
X04 += X03
X03 = (((X03) << (R1024_6_2)) | ((X03) >> (64-(R1024_6_2))))
X03 ^= X04
X06 += X01
X01 = (((X01) << (R1024_6_3)) | ((X01) >> (64-(R1024_6_3))))
X01 ^= X06
X12 += X15
X15 = (((X15) << (R1024_6_4)) | ((X15) >> (64-(R1024_6_4))))
X15 ^= X12
X14 += X13
X13 = (((X13) << (R1024_6_5)) | ((X13) >> (64-(R1024_6_5))))
X13 ^= X14
X08 += X11
X11 = (((X11) << (R1024_6_6)) | ((X11) >> (64-(R1024_6_6))))
X11 ^= X08
X10 += X09
X09 = (((X09) << (R1024_6_7)) | ((X09) >> (64-(R1024_6_7))))
X09 ^= X10
X00 += X15
X15 = (((X15) << (R1024_7_0)) | ((X15) >> (64-(R1024_7_0))))
X15 ^= X00
X02 += X11
X11 = (((X11) << (R1024_7_1)) | ((X11) >> (64-(R1024_7_1))))
X11 ^= X02
X06 += X13
X13 = (((X13) << (R1024_7_2)) | ((X13) >> (64-(R1024_7_2))))
X13 ^= X06
X04 += X09
X09 = (((X09) << (R1024_7_3)) | ((X09) >> (64-(R1024_7_3))))
X09 ^= X04
X14 += X01
X01 = (((X01) << (R1024_7_4)) | ((X01) >> (64-(R1024_7_4))))
X01 ^= X14
X08 += X05
X05 = (((X05) << (R1024_7_5)) | ((X05) >> (64-(R1024_7_5))))
X05 ^= X08
X10 += X03
X03 = (((X03) << (R1024_7_6)) | ((X03) >> (64-(R1024_7_6))))
X03 ^= X10
X12 += X07
X07 = (((X07) << (R1024_7_7)) | ((X07) >> (64-(R1024_7_7))))
X07 ^= X12
X00 += ks[((2*(4)+1)+ 1) % 17]
X01 += ks[((2*(4)+1)+ 2) % 17]
X02 += ks[((2*(4)+1)+ 3) % 17]
X03 += ks[((2*(4)+1)+ 4) % 17]
X04 += ks[((2*(4)+1)+ 5) % 17]
X05 += ks[((2*(4)+1)+ 6) % 17]
X06 += ks[((2*(4)+1)+ 7) % 17]
X07 += ks[((2*(4)+1)+ 8) % 17]
X08 += ks[((2*(4)+1)+ 9) % 17]
X09 += ks[((2*(4)+1)+10) % 17]
X10 += ks[((2*(4)+1)+11) % 17]
X11 += ks[((2*(4)+1)+12) % 17]
X12 += ks[((2*(4)+1)+13) % 17]
X13 += ks[((2*(4)+1)+14) % 17] + kw[((2*(4)+1)+1) % 3]
X14 += ks[((2*(4)+1)+15) % 17] + kw[((2*(4)+1)+2) % 3]
X15 += ks[((2*(4)+1)+16) % 17] + (2*(4)+1)+1
X00 += X01
X01 = (((X01) << (R1024_0_0)) | ((X01) >> (64-(R1024_0_0))))
X01 ^= X00
X02 += X03
X03 = (((X03) << (R1024_0_1)) | ((X03) >> (64-(R1024_0_1))))
X03 ^= X02
X04 += X05
X05 = (((X05) << (R1024_0_2)) | ((X05) >> (64-(R1024_0_2))))
X05 ^= X04
X06 += X07
X07 = (((X07) << (R1024_0_3)) | ((X07) >> (64-(R1024_0_3))))
X07 ^= X06
X08 += X09
X09 = (((X09) << (R1024_0_4)) | ((X09) >> (64-(R1024_0_4))))
X09 ^= X08
X10 += X11
X11 = (((X11) << (R1024_0_5)) | ((X11) >> (64-(R1024_0_5))))
X11 ^= X10
X12 += X13
X13 = (((X13) << (R1024_0_6)) | ((X13) >> (64-(R1024_0_6))))
X13 ^= X12
X14 += X15
X15 = (((X15) << (R1024_0_7)) | ((X15) >> (64-(R1024_0_7))))
X15 ^= X14
X00 += X09
X09 = (((X09) << (R1024_1_0)) | ((X09) >> (64-(R1024_1_0))))
X09 ^= X00
X02 += X13
X13 = (((X13) << (R1024_1_1)) | ((X13) >> (64-(R1024_1_1))))
X13 ^= X02
X06 += X11
X11 = (((X11) << (R1024_1_2)) | ((X11) >> (64-(R1024_1_2))))
X11 ^= X06
X04 += X15
X15 = (((X15) << (R1024_1_3)) | ((X15) >> (64-(R1024_1_3))))
X15 ^= X04
X10 += X07
X07 = (((X07) << (R1024_1_4)) | ((X07) >> (64-(R1024_1_4))))
X07 ^= X10
X12 += X03
X03 = (((X03) << (R1024_1_5)) | ((X03) >> (64-(R1024_1_5))))
X03 ^= X12
X14 += X05
X05 = (((X05) << (R1024_1_6)) | ((X05) >> (64-(R1024_1_6))))
X05 ^= X14
X08 += X01
X01 = (((X01) << (R1024_1_7)) | ((X01) >> (64-(R1024_1_7))))
X01 ^= X08
X00 += X07
X07 = (((X07) << (R1024_2_0)) | ((X07) >> (64-(R1024_2_0))))
X07 ^= X00
X02 += X05
X05 = (((X05) << (R1024_2_1)) | ((X05) >> (64-(R1024_2_1))))
X05 ^= X02
X04 += X03
X03 = (((X03) << (R1024_2_2)) | ((X03) >> (64-(R1024_2_2))))
X03 ^= X04
X06 += X01
X01 = (((X01) << (R1024_2_3)) | ((X01) >> (64-(R1024_2_3))))
X01 ^= X06
X12 += X15
X15 = (((X15) << (R1024_2_4)) | ((X15) >> (64-(R1024_2_4))))
X15 ^= X12
X14 += X13
X13 = (((X13) << (R1024_2_5)) | ((X13) >> (64-(R1024_2_5))))
X13 ^= X14
X08 += X11
X11 = (((X11) << (R1024_2_6)) | ((X11) >> (64-(R1024_2_6))))
X11 ^= X08
X10 += X09
X09 = (((X09) << (R1024_2_7)) | ((X09) >> (64-(R1024_2_7))))
X09 ^= X10
X00 += X15
X15 = (((X15) << (R1024_3_0)) | ((X15) >> (64-(R1024_3_0))))
X15 ^= X00
X02 += X11
X11 = (((X11) << (R1024_3_1)) | ((X11) >> (64-(R1024_3_1))))
X11 ^= X02
X06 += X13
X13 = (((X13) << (R1024_3_2)) | ((X13) >> (64-(R1024_3_2))))
X13 ^= X06
X04 += X09
X09 = (((X09) << (R1024_3_3)) | ((X09) >> (64-(R1024_3_3))))
X09 ^= X04
X14 += X01
X01 = (((X01) << (R1024_3_4)) | ((X01) >> (64-(R1024_3_4))))
X01 ^= X14
X08 += X05
X05 = (((X05) << (R1024_3_5)) | ((X05) >> (64-(R1024_3_5))))
X05 ^= X08
X10 += X03
X03 = (((X03) << (R1024_3_6)) | ((X03) >> (64-(R1024_3_6))))
X03 ^= X10
X12 += X07
X07 = (((X07) << (R1024_3_7)) | ((X07) >> (64-(R1024_3_7))))
X07 ^= X12
X00 += ks[((2*(5))+ 1) % 17]
X01 += ks[((2*(5))+ 2) % 17]
X02 += ks[((2*(5))+ 3) % 17]
X03 += ks[((2*(5))+ 4) % 17]
X04 += ks[((2*(5))+ 5) % 17]
X05 += ks[((2*(5))+ 6) % 17]
X06 += ks[((2*(5))+ 7) % 17]
X07 += ks[((2*(5))+ 8) % 17]
X08 += ks[((2*(5))+ 9) % 17]
X09 += ks[((2*(5))+10) % 17]
X10 += ks[((2*(5))+11) % 17]
X11 += ks[((2*(5))+12) % 17]
X12 += ks[((2*(5))+13) % 17]
X13 += ks[((2*(5))+14) % 17] + kw[((2*(5))+1) % 3]
X14 += ks[((2*(5))+15) % 17] + kw[((2*(5))+2) % 3]
X15 += ks[((2*(5))+16) % 17] + (2*(5))+1
X00 += X01
X01 = (((X01) << (R1024_4_0)) | ((X01) >> (64-(R1024_4_0))))
X01 ^= X00
X02 += X03
X03 = (((X03) << (R1024_4_1)) | ((X03) >> (64-(R1024_4_1))))
X03 ^= X02
X04 += X05
X05 = (((X05) << (R1024_4_2)) | ((X05) >> (64-(R1024_4_2))))
X05 ^= X04
X06 += X07
X07 = (((X07) << (R1024_4_3)) | ((X07) >> (64-(R1024_4_3))))
X07 ^= X06
X08 += X09
X09 = (((X09) << (R1024_4_4)) | ((X09) >> (64-(R1024_4_4))))
X09 ^= X08
X10 += X11
X11 = (((X11) << (R1024_4_5)) | ((X11) >> (64-(R1024_4_5))))
X11 ^= X10
X12 += X13
X13 = (((X13) << (R1024_4_6)) | ((X13) >> (64-(R1024_4_6))))
X13 ^= X12
X14 += X15
X15 = (((X15) << (R1024_4_7)) | ((X15) >> (64-(R1024_4_7))))
X15 ^= X14
X00 += X09
X09 = (((X09) << (R1024_5_0)) | ((X09) >> (64-(R1024_5_0))))
X09 ^= X00
X02 += X13
X13 = (((X13) << (R1024_5_1)) | ((X13) >> (64-(R1024_5_1))))
X13 ^= X02
X06 += X11
X11 = (((X11) << (R1024_5_2)) | ((X11) >> (64-(R1024_5_2))))
X11 ^= X06
X04 += X15
X15 = (((X15) << (R1024_5_3)) | ((X15) >> (64-(R1024_5_3))))
X15 ^= X04
X10 += X07
X07 = (((X07) << (R1024_5_4)) | ((X07) >> (64-(R1024_5_4))))
X07 ^= X10
X12 += X03
X03 = (((X03) << (R1024_5_5)) | ((X03) >> (64-(R1024_5_5))))
X03 ^= X12
X14 += X05
X05 = (((X05) << (R1024_5_6)) | ((X05) >> (64-(R1024_5_6))))
X05 ^= X14
X08 += X01
X01 = (((X01) << (R1024_5_7)) | ((X01) >> (64-(R1024_5_7))))
X01 ^= X08
X00 += X07
X07 = (((X07) << (R1024_6_0)) | ((X07) >> (64-(R1024_6_0))))
X07 ^= X00
X02 += X05
X05 = (((X05) << (R1024_6_1)) | ((X05) >> (64-(R1024_6_1))))
X05 ^= X02
X04 += X03
X03 = (((X03) << (R1024_6_2)) | ((X03) >> (64-(R1024_6_2))))
X03 ^= X04
X06 += X01
X01 = (((X01) << (R1024_6_3)) | ((X01) >> (64-(R1024_6_3))))
X01 ^= X06
X12 += X15
X15 = (((X15) << (R1024_6_4)) | ((X15) >> (64-(R1024_6_4))))
X15 ^= X12
X14 += X13
X13 = (((X13) << (R1024_6_5)) | ((X13) >> (64-(R1024_6_5))))
X13 ^= X14
X08 += X11
X11 = (((X11) << (R1024_6_6)) | ((X11) >> (64-(R1024_6_6))))
X11 ^= X08
X10 += X09
X09 = (((X09) << (R1024_6_7)) | ((X09) >> (64-(R1024_6_7))))
X09 ^= X10
X00 += X15
X15 = (((X15) << (R1024_7_0)) | ((X15) >> (64-(R1024_7_0))))
X15 ^= X00
X02 += X11
X11 = (((X11) << (R1024_7_1)) | ((X11) >> (64-(R1024_7_1))))
X11 ^= X02
X06 += X13
X13 = (((X13) << (R1024_7_2)) | ((X13) >> (64-(R1024_7_2))))
X13 ^= X06
X04 += X09
X09 = (((X09) << (R1024_7_3)) | ((X09) >> (64-(R1024_7_3))))
X09 ^= X04
X14 += X01
X01 = (((X01) << (R1024_7_4)) | ((X01) >> (64-(R1024_7_4))))
X01 ^= X14
X08 += X05
X05 = (((X05) << (R1024_7_5)) | ((X05) >> (64-(R1024_7_5))))
X05 ^= X08
X10 += X03
X03 = (((X03) << (R1024_7_6)) | ((X03) >> (64-(R1024_7_6))))
X03 ^= X10
X12 += X07
X07 = (((X07) << (R1024_7_7)) | ((X07) >> (64-(R1024_7_7))))
X07 ^= X12
X00 += ks[((2*(5)+1)+ 1) % 17]
X01 += ks[((2*(5)+1)+ 2) % 17]
X02 += ks[((2*(5)+1)+ 3) % 17]
X03 += ks[((2*(5)+1)+ 4) % 17]
X04 += ks[((2*(5)+1)+ 5) % 17]
X05 += ks[((2*(5)+1)+ 6) % 17]
X06 += ks[((2*(5)+1)+ 7) % 17]
X07 += ks[((2*(5)+1)+ 8) % 17]
X08 += ks[((2*(5)+1)+ 9) % 17]
X09 += ks[((2*(5)+1)+10) % 17]
X10 += ks[((2*(5)+1)+11) % 17]
X11 += ks[((2*(5)+1)+12) % 17]
X12 += ks[((2*(5)+1)+13) % 17]
X13 += ks[((2*(5)+1)+14) % 17] + kw[((2*(5)+1)+1) % 3]
X14 += ks[((2*(5)+1)+15) % 17] + kw[((2*(5)+1)+2) % 3]
X15 += ks[((2*(5)+1)+16) % 17] + (2*(5)+1)+1
X00 += X01
X01 = (((X01) << (R1024_0_0)) | ((X01) >> (64-(R1024_0_0))))
X01 ^= X00
X02 += X03
X03 = (((X03) << (R1024_0_1)) | ((X03) >> (64-(R1024_0_1))))
X03 ^= X02
X04 += X05
X05 = (((X05) << (R1024_0_2)) | ((X05) >> (64-(R1024_0_2))))
X05 ^= X04
X06 += X07
X07 = (((X07) << (R1024_0_3)) | ((X07) >> (64-(R1024_0_3))))
X07 ^= X06
X08 += X09
X09 = (((X09) << (R1024_0_4)) | ((X09) >> (64-(R1024_0_4))))
X09 ^= X08
X10 += X11
X11 = (((X11) << (R1024_0_5)) | ((X11) >> (64-(R1024_0_5))))
X11 ^= X10
X12 += X13
X13 = (((X13) << (R1024_0_6)) | ((X13) >> (64-(R1024_0_6))))
X13 ^= X12
X14 += X15
X15 = (((X15) << (R1024_0_7)) | ((X15) >> (64-(R1024_0_7))))
X15 ^= X14
X00 += X09
X09 = (((X09) << (R1024_1_0)) | ((X09) >> (64-(R1024_1_0))))
X09 ^= X00
X02 += X13
X13 = (((X13) << (R1024_1_1)) | ((X13) >> (64-(R1024_1_1))))
X13 ^= X02
X06 += X11
X11 = (((X11) << (R1024_1_2)) | ((X11) >> (64-(R1024_1_2))))
X11 ^= X06
X04 += X15
X15 = (((X15) << (R1024_1_3)) | ((X15) >> (64-(R1024_1_3))))
X15 ^= X04
X10 += X07
X07 = (((X07) << (R1024_1_4)) | ((X07) >> (64-(R1024_1_4))))
X07 ^= X10
X12 += X03
X03 = (((X03) << (R1024_1_5)) | ((X03) >> (64-(R1024_1_5))))
X03 ^= X12
X14 += X05
X05 = (((X05) << (R1024_1_6)) | ((X05) >> (64-(R1024_1_6))))
X05 ^= X14
X08 += X01
X01 = (((X01) << (R1024_1_7)) | ((X01) >> (64-(R1024_1_7))))
X01 ^= X08
X00 += X07
X07 = (((X07) << (R1024_2_0)) | ((X07) >> (64-(R1024_2_0))))
X07 ^= X00
X02 += X05
X05 = (((X05) << (R1024_2_1)) | ((X05) >> (64-(R1024_2_1))))
X05 ^= X02
X04 += X03
X03 = (((X03) << (R1024_2_2)) | ((X03) >> (64-(R1024_2_2))))
X03 ^= X04
X06 += X01
X01 = (((X01) << (R1024_2_3)) | ((X01) >> (64-(R1024_2_3))))
X01 ^= X06
X12 += X15
X15 = (((X15) << (R1024_2_4)) | ((X15) >> (64-(R1024_2_4))))
X15 ^= X12
X14 += X13
X13 = (((X13) << (R1024_2_5)) | ((X13) >> (64-(R1024_2_5))))
X13 ^= X14
X08 += X11
X11 = (((X11) << (R1024_2_6)) | ((X11) >> (64-(R1024_2_6))))
X11 ^= X08
X10 += X09
X09 = (((X09) << (R1024_2_7)) | ((X09) >> (64-(R1024_2_7))))
X09 ^= X10
X00 += X15
X15 = (((X15) << (R1024_3_0)) | ((X15) >> (64-(R1024_3_0))))
X15 ^= X00
X02 += X11
X11 = (((X11) << (R1024_3_1)) | ((X11) >> (64-(R1024_3_1))))
X11 ^= X02
X06 += X13
X13 = (((X13) << (R1024_3_2)) | ((X13) >> (64-(R1024_3_2))))
X13 ^= X06
X04 += X09
X09 = (((X09) << (R1024_3_3)) | ((X09) >> (64-(R1024_3_3))))
X09 ^= X04
X14 += X01
X01 = (((X01) << (R1024_3_4)) | ((X01) >> (64-(R1024_3_4))))
X01 ^= X14
X08 += X05
X05 = (((X05) << (R1024_3_5)) | ((X05) >> (64-(R1024_3_5))))
X05 ^= X08
X10 += X03
X03 = (((X03) << (R1024_3_6)) | ((X03) >> (64-(R1024_3_6))))
X03 ^= X10
X12 += X07
X07 = (((X07) << (R1024_3_7)) | ((X07) >> (64-(R1024_3_7))))
X07 ^= X12
X00 += ks[((2*(6))+ 1) % 17]
X01 += ks[((2*(6))+ 2) % 17]
X02 += ks[((2*(6))+ 3) % 17]
X03 += ks[((2*(6))+ 4) % 17]
X04 += ks[((2*(6))+ 5) % 17]
X05 += ks[((2*(6))+ 6) % 17]
X06 += ks[((2*(6))+ 7) % 17]
X07 += ks[((2*(6))+ 8) % 17]
X08 += ks[((2*(6))+ 9) % 17]
X09 += ks[((2*(6))+10) % 17]
X10 += ks[((2*(6))+11) % 17]
X11 += ks[((2*(6))+12) % 17]
X12 += ks[((2*(6))+13) % 17]
X13 += ks[((2*(6))+14) % 17] + kw[((2*(6))+1) % 3]
X14 += ks[((2*(6))+15) % 17] + kw[((2*(6))+2) % 3]
X15 += ks[((2*(6))+16) % 17] + (2*(6))+1
X00 += X01
X01 = (((X01) << (R1024_4_0)) | ((X01) >> (64-(R1024_4_0))))
X01 ^= X00
X02 += X03
X03 = (((X03) << (R1024_4_1)) | ((X03) >> (64-(R1024_4_1))))
X03 ^= X02
X04 += X05
X05 = (((X05) << (R1024_4_2)) | ((X05) >> (64-(R1024_4_2))))
X05 ^= X04
X06 += X07
X07 = (((X07) << (R1024_4_3)) | ((X07) >> (64-(R1024_4_3))))
X07 ^= X06
X08 += X09
X09 = (((X09) << (R1024_4_4)) | ((X09) >> (64-(R1024_4_4))))
X09 ^= X08
X10 += X11
X11 = (((X11) << (R1024_4_5)) | ((X11) >> (64-(R1024_4_5))))
X11 ^= X10
X12 += X13
X13 = (((X13) << (R1024_4_6)) | ((X13) >> (64-(R1024_4_6))))
X13 ^= X12
X14 += X15
X15 = (((X15) << (R1024_4_7)) | ((X15) >> (64-(R1024_4_7))))
X15 ^= X14
X00 += X09
X09 = (((X09) << (R1024_5_0)) | ((X09) >> (64-(R1024_5_0))))
X09 ^= X00
X02 += X13
X13 = (((X13) << (R1024_5_1)) | ((X13) >> (64-(R1024_5_1))))
X13 ^= X02
X06 += X11
X11 = (((X11) << (R1024_5_2)) | ((X11) >> (64-(R1024_5_2))))
X11 ^= X06
X04 += X15
X15 = (((X15) << (R1024_5_3)) | ((X15) >> (64-(R1024_5_3))))
X15 ^= X04
X10 += X07
X07 = (((X07) << (R1024_5_4)) | ((X07) >> (64-(R1024_5_4))))
X07 ^= X10
X12 += X03
X03 = (((X03) << (R1024_5_5)) | ((X03) >> (64-(R1024_5_5))))
X03 ^= X12
X14 += X05
X05 = (((X05) << (R1024_5_6)) | ((X05) >> (64-(R1024_5_6))))
X05 ^= X14
X08 += X01
X01 = (((X01) << (R1024_5_7)) | ((X01) >> (64-(R1024_5_7))))
X01 ^= X08
X00 += X07
X07 = (((X07) << (R1024_6_0)) | ((X07) >> (64-(R1024_6_0))))
X07 ^= X00
X02 += X05
X05 = (((X05) << (R1024_6_1)) | ((X05) >> (64-(R1024_6_1))))
X05 ^= X02
X04 += X03
X03 = (((X03) << (R1024_6_2)) | ((X03) >> (64-(R1024_6_2))))
X03 ^= X04
X06 += X01
X01 = (((X01) << (R1024_6_3)) | ((X01) >> (64-(R1024_6_3))))
X01 ^= X06
X12 += X15
X15 = (((X15) << (R1024_6_4)) | ((X15) >> (64-(R1024_6_4))))
X15 ^= X12
X14 += X13
X13 = (((X13) << (R1024_6_5)) | ((X13) >> (64-(R1024_6_5))))
X13 ^= X14
X08 += X11
X11 = (((X11) << (R1024_6_6)) | ((X11) >> (64-(R1024_6_6))))
X11 ^= X08
X10 += X09
X09 = (((X09) << (R1024_6_7)) | ((X09) >> (64-(R1024_6_7))))
X09 ^= X10
X00 += X15
X15 = (((X15) << (R1024_7_0)) | ((X15) >> (64-(R1024_7_0))))
X15 ^= X00
X02 += X11
X11 = (((X11) << (R1024_7_1)) | ((X11) >> (64-(R1024_7_1))))
X11 ^= X02
X06 += X13
X13 = (((X13) << (R1024_7_2)) | ((X13) >> (64-(R1024_7_2))))
X13 ^= X06
X04 += X09
X09 = (((X09) << (R1024_7_3)) | ((X09) >> (64-(R1024_7_3))))
X09 ^= X04
X14 += X01
X01 = (((X01) << (R1024_7_4)) | ((X01) >> (64-(R1024_7_4))))
X01 ^= X14
X08 += X05
X05 = (((X05) << (R1024_7_5)) | ((X05) >> (64-(R1024_7_5))))
X05 ^= X08
X10 += X03
X03 = (((X03) << (R1024_7_6)) | ((X03) >> (64-(R1024_7_6))))
X03 ^= X10
X12 += X07
X07 = (((X07) << (R1024_7_7)) | ((X07) >> (64-(R1024_7_7))))
X07 ^= X12
X00 += ks[((2*(6)+1)+ 1) % 17]
X01 += ks[((2*(6)+1)+ 2) % 17]
X02 += ks[((2*(6)+1)+ 3) % 17]
X03 += ks[((2*(6)+1)+ 4) % 17]
X04 += ks[((2*(6)+1)+ 5) % 17]
X05 += ks[((2*(6)+1)+ 6) % 17]
X06 += ks[((2*(6)+1)+ 7) % 17]
X07 += ks[((2*(6)+1)+ 8) % 17]
X08 += ks[((2*(6)+1)+ 9) % 17]
X09 += ks[((2*(6)+1)+10) % 17]
X10 += ks[((2*(6)+1)+11) % 17]
X11 += ks[((2*(6)+1)+12) % 17]
X12 += ks[((2*(6)+1)+13) % 17]
X13 += ks[((2*(6)+1)+14) % 17] + kw[((2*(6)+1)+1) % 3]
X14 += ks[((2*(6)+1)+15) % 17] + kw[((2*(6)+1)+2) % 3]
X15 += ks[((2*(6)+1)+16) % 17] + (2*(6)+1)+1
X00 += X01
X01 = (((X01) << (R1024_0_0)) | ((X01) >> (64-(R1024_0_0))))
X01 ^= X00
X02 += X03
X03 = (((X03) << (R1024_0_1)) | ((X03) >> (64-(R1024_0_1))))
X03 ^= X02
X04 += X05
X05 = (((X05) << (R1024_0_2)) | ((X05) >> (64-(R1024_0_2))))
X05 ^= X04
X06 += X07
X07 = (((X07) << (R1024_0_3)) | ((X07) >> (64-(R1024_0_3))))
X07 ^= X06
X08 += X09
X09 = (((X09) << (R1024_0_4)) | ((X09) >> (64-(R1024_0_4))))
X09 ^= X08
X10 += X11
X11 = (((X11) << (R1024_0_5)) | ((X11) >> (64-(R1024_0_5))))
X11 ^= X10
X12 += X13
X13 = (((X13) << (R1024_0_6)) | ((X13) >> (64-(R1024_0_6))))
X13 ^= X12
X14 += X15
X15 = (((X15) << (R1024_0_7)) | ((X15) >> (64-(R1024_0_7))))
X15 ^= X14
X00 += X09
X09 = (((X09) << (R1024_1_0)) | ((X09) >> (64-(R1024_1_0))))
X09 ^= X00
X02 += X13
X13 = (((X13) << (R1024_1_1)) | ((X13) >> (64-(R1024_1_1))))
X13 ^= X02
X06 += X11
X11 = (((X11) << (R1024_1_2)) | ((X11) >> (64-(R1024_1_2))))
X11 ^= X06
X04 += X15
X15 = (((X15) << (R1024_1_3)) | ((X15) >> (64-(R1024_1_3))))
X15 ^= X04
X10 += X07
X07 = (((X07) << (R1024_1_4)) | ((X07) >> (64-(R1024_1_4))))
X07 ^= X10
X12 += X03
X03 = (((X03) << (R1024_1_5)) | ((X03) >> (64-(R1024_1_5))))
X03 ^= X12
X14 += X05
X05 = (((X05) << (R1024_1_6)) | ((X05) >> (64-(R1024_1_6))))
X05 ^= X14
X08 += X01
X01 = (((X01) << (R1024_1_7)) | ((X01) >> (64-(R1024_1_7))))
X01 ^= X08
X00 += X07
X07 = (((X07) << (R1024_2_0)) | ((X07) >> (64-(R1024_2_0))))
X07 ^= X00
X02 += X05
X05 = (((X05) << (R1024_2_1)) | ((X05) >> (64-(R1024_2_1))))
X05 ^= X02
X04 += X03
X03 = (((X03) << (R1024_2_2)) | ((X03) >> (64-(R1024_2_2))))
X03 ^= X04
X06 += X01
X01 = (((X01) << (R1024_2_3)) | ((X01) >> (64-(R1024_2_3))))
X01 ^= X06
X12 += X15
X15 = (((X15) << (R1024_2_4)) | ((X15) >> (64-(R1024_2_4))))
X15 ^= X12
X14 += X13
X13 = (((X13) << (R1024_2_5)) | ((X13) >> (64-(R1024_2_5))))
X13 ^= X14
X08 += X11
X11 = (((X11) << (R1024_2_6)) | ((X11) >> (64-(R1024_2_6))))
X11 ^= X08
X10 += X09
X09 = (((X09) << (R1024_2_7)) | ((X09) >> (64-(R1024_2_7))))
X09 ^= X10
X00 += X15
X15 = (((X15) << (R1024_3_0)) | ((X15) >> (64-(R1024_3_0))))
X15 ^= X00
X02 += X11
X11 = (((X11) << (R1024_3_1)) | ((X11) >> (64-(R1024_3_1))))
X11 ^= X02
X06 += X13
X13 = (((X13) << (R1024_3_2)) | ((X13) >> (64-(R1024_3_2))))
X13 ^= X06
X04 += X09
X09 = (((X09) << (R1024_3_3)) | ((X09) >> (64-(R1024_3_3))))
X09 ^= X04
X14 += X01
X01 = (((X01) << (R1024_3_4)) | ((X01) >> (64-(R1024_3_4))))
X01 ^= X14
X08 += X05
X05 = (((X05) << (R1024_3_5)) | ((X05) >> (64-(R1024_3_5))))
X05 ^= X08
X10 += X03
X03 = (((X03) << (R1024_3_6)) | ((X03) >> (64-(R1024_3_6))))
X03 ^= X10
X12 += X07
X07 = (((X07) << (R1024_3_7)) | ((X07) >> (64-(R1024_3_7))))
X07 ^= X12
X00 += ks[((2*(7))+ 1) % 17]
X01 += ks[((2*(7))+ 2) % 17]
X02 += ks[((2*(7))+ 3) % 17]
X03 += ks[((2*(7))+ 4) % 17]
X04 += ks[((2*(7))+ 5) % 17]
X05 += ks[((2*(7))+ 6) % 17]
X06 += ks[((2*(7))+ 7) % 17]
X07 += ks[((2*(7))+ 8) % 17]
X08 += ks[((2*(7))+ 9) % 17]
X09 += ks[((2*(7))+10) % 17]
X10 += ks[((2*(7))+11) % 17]
X11 += ks[((2*(7))+12) % 17]
X12 += ks[((2*(7))+13) % 17]
X13 += ks[((2*(7))+14) % 17] + kw[((2*(7))+1) % 3]
X14 += ks[((2*(7))+15) % 17] + kw[((2*(7))+2) % 3]
X15 += ks[((2*(7))+16) % 17] + (2*(7))+1
X00 += X01
X01 = (((X01) << (R1024_4_0)) | ((X01) >> (64-(R1024_4_0))))
X01 ^= X00
X02 += X03
X03 = (((X03) << (R1024_4_1)) | ((X03) >> (64-(R1024_4_1))))
X03 ^= X02
X04 += X05
X05 = (((X05) << (R1024_4_2)) | ((X05) >> (64-(R1024_4_2))))
X05 ^= X04
X06 += X07
X07 = (((X07) << (R1024_4_3)) | ((X07) >> (64-(R1024_4_3))))
X07 ^= X06
X08 += X09
X09 = (((X09) << (R1024_4_4)) | ((X09) >> (64-(R1024_4_4))))
X09 ^= X08
X10 += X11
X11 = (((X11) << (R1024_4_5)) | ((X11) >> (64-(R1024_4_5))))
X11 ^= X10
X12 += X13
X13 = (((X13) << (R1024_4_6)) | ((X13) >> (64-(R1024_4_6))))
X13 ^= X12
X14 += X15
X15 = (((X15) << (R1024_4_7)) | ((X15) >> (64-(R1024_4_7))))
X15 ^= X14
X00 += X09
X09 = (((X09) << (R1024_5_0)) | ((X09) >> (64-(R1024_5_0))))
X09 ^= X00
X02 += X13
X13 = (((X13) << (R1024_5_1)) | ((X13) >> (64-(R1024_5_1))))
X13 ^= X02
X06 += X11
X11 = (((X11) << (R1024_5_2)) | ((X11) >> (64-(R1024_5_2))))
X11 ^= X06
X04 += X15
X15 = (((X15) << (R1024_5_3)) | ((X15) >> (64-(R1024_5_3))))
X15 ^= X04
X10 += X07
X07 = (((X07) << (R1024_5_4)) | ((X07) >> (64-(R1024_5_4))))
X07 ^= X10
X12 += X03
X03 = (((X03) << (R1024_5_5)) | ((X03) >> (64-(R1024_5_5))))
X03 ^= X12
X14 += X05
X05 = (((X05) << (R1024_5_6)) | ((X05) >> (64-(R1024_5_6))))
X05 ^= X14
X08 += X01
X01 = (((X01) << (R1024_5_7)) | ((X01) >> (64-(R1024_5_7))))
X01 ^= X08
X00 += X07
X07 = (((X07) << (R1024_6_0)) | ((X07) >> (64-(R1024_6_0))))
X07 ^= X00
X02 += X05
X05 = (((X05) << (R1024_6_1)) | ((X05) >> (64-(R1024_6_1))))
X05 ^= X02
X04 += X03
X03 = (((X03) << (R1024_6_2)) | ((X03) >> (64-(R1024_6_2))))
X03 ^= X04
X06 += X01
X01 = (((X01) << (R1024_6_3)) | ((X01) >> (64-(R1024_6_3))))
X01 ^= X06
X12 += X15
X15 = (((X15) << (R1024_6_4)) | ((X15) >> (64-(R1024_6_4))))
X15 ^= X12
X14 += X13
X13 = (((X13) << (R1024_6_5)) | ((X13) >> (64-(R1024_6_5))))
X13 ^= X14
X08 += X11
X11 = (((X11) << (R1024_6_6)) | ((X11) >> (64-(R1024_6_6))))
X11 ^= X08
X10 += X09
X09 = (((X09) << (R1024_6_7)) | ((X09) >> (64-(R1024_6_7))))
X09 ^= X10
X00 += X15
X15 = (((X15) << (R1024_7_0)) | ((X15) >> (64-(R1024_7_0))))
X15 ^= X00
X02 += X11
X11 = (((X11) << (R1024_7_1)) | ((X11) >> (64-(R1024_7_1))))
X11 ^= X02
X06 += X13
X13 = (((X13) << (R1024_7_2)) | ((X13) >> (64-(R1024_7_2))))
X13 ^= X06
X04 += X09
X09 = (((X09) << (R1024_7_3)) | ((X09) >> (64-(R1024_7_3))))
X09 ^= X04
X14 += X01
X01 = (((X01) << (R1024_7_4)) | ((X01) >> (64-(R1024_7_4))))
X01 ^= X14
X08 += X05
X05 = (((X05) << (R1024_7_5)) | ((X05) >> (64-(R1024_7_5))))
X05 ^= X08
X10 += X03
X03 = (((X03) << (R1024_7_6)) | ((X03) >> (64-(R1024_7_6))))
X03 ^= X10
X12 += X07
X07 = (((X07) << (R1024_7_7)) | ((X07) >> (64-(R1024_7_7))))
X07 ^= X12
X00 += ks[((2*(7)+1)+ 1) % 17]
X01 += ks[((2*(7)+1)+ 2) % 17]
X02 += ks[((2*(7)+1)+ 3) % 17]
X03 += ks[((2*(7)+1)+ 4) % 17]
X04 += ks[((2*(7)+1)+ 5) % 17]
X05 += ks[((2*(7)+1)+ 6) % 17]
X06 += ks[((2*(7)+1)+ 7) % 17]
X07 += ks[((2*(7)+1)+ 8) % 17]
X08 += ks[((2*(7)+1)+ 9) % 17]
X09 += ks[((2*(7)+1)+10) % 17]
X10 += ks[((2*(7)+1)+11) % 17]
X11 += ks[((2*(7)+1)+12) % 17]
X12 += ks[((2*(7)+1)+13) % 17]
X13 += ks[((2*(7)+1)+14) % 17] + kw[((2*(7)+1)+1) % 3]
X14 += ks[((2*(7)+1)+15) % 17] + kw[((2*(7)+1)+2) % 3]
X15 += ks[((2*(7)+1)+16) % 17] + (2*(7)+1)+1
X00 += X01
X01 = (((X01) << (R1024_0_0)) | ((X01) >> (64-(R1024_0_0))))
X01 ^= X00
X02 += X03
X03 = (((X03) << (R1024_0_1)) | ((X03) >> (64-(R1024_0_1))))
X03 ^= X02
X04 += X05
X05 = (((X05) << (R1024_0_2)) | ((X05) >> (64-(R1024_0_2))))
X05 ^= X04
X06 += X07
X07 = (((X07) << (R1024_0_3)) | ((X07) >> (64-(R1024_0_3))))
X07 ^= X06
X08 += X09
X09 = (((X09) << (R1024_0_4)) | ((X09) >> (64-(R1024_0_4))))
X09 ^= X08
X10 += X11
X11 = (((X11) << (R1024_0_5)) | ((X11) >> (64-(R1024_0_5))))
X11 ^= X10
X12 += X13
X13 = (((X13) << (R1024_0_6)) | ((X13) >> (64-(R1024_0_6))))
X13 ^= X12
X14 += X15
X15 = (((X15) << (R1024_0_7)) | ((X15) >> (64-(R1024_0_7))))
X15 ^= X14
X00 += X09
X09 = (((X09) << (R1024_1_0)) | ((X09) >> (64-(R1024_1_0))))
X09 ^= X00
X02 += X13
X13 = (((X13) << (R1024_1_1)) | ((X13) >> (64-(R1024_1_1))))
X13 ^= X02
X06 += X11
X11 = (((X11) << (R1024_1_2)) | ((X11) >> (64-(R1024_1_2))))
X11 ^= X06
X04 += X15
X15 = (((X15) << (R1024_1_3)) | ((X15) >> (64-(R1024_1_3))))
X15 ^= X04
X10 += X07
X07 = (((X07) << (R1024_1_4)) | ((X07) >> (64-(R1024_1_4))))
X07 ^= X10
X12 += X03
X03 = (((X03) << (R1024_1_5)) | ((X03) >> (64-(R1024_1_5))))
X03 ^= X12
X14 += X05
X05 = (((X05) << (R1024_1_6)) | ((X05) >> (64-(R1024_1_6))))
X05 ^= X14
X08 += X01
X01 = (((X01) << (R1024_1_7)) | ((X01) >> (64-(R1024_1_7))))
X01 ^= X08
X00 += X07
X07 = (((X07) << (R1024_2_0)) | ((X07) >> (64-(R1024_2_0))))
X07 ^= X00
X02 += X05
X05 = (((X05) << (R1024_2_1)) | ((X05) >> (64-(R1024_2_1))))
X05 ^= X02
X04 += X03
X03 = (((X03) << (R1024_2_2)) | ((X03) >> (64-(R1024_2_2))))
X03 ^= X04
X06 += X01
X01 = (((X01) << (R1024_2_3)) | ((X01) >> (64-(R1024_2_3))))
X01 ^= X06
X12 += X15
X15 = (((X15) << (R1024_2_4)) | ((X15) >> (64-(R1024_2_4))))
X15 ^= X12
X14 += X13
X13 = (((X13) << (R1024_2_5)) | ((X13) >> (64-(R1024_2_5))))
X13 ^= X14
X08 += X11
X11 = (((X11) << (R1024_2_6)) | ((X11) >> (64-(R1024_2_6))))
X11 ^= X08
X10 += X09
X09 = (((X09) << (R1024_2_7)) | ((X09) >> (64-(R1024_2_7))))
X09 ^= X10
X00 += X15
X15 = (((X15) << (R1024_3_0)) | ((X15) >> (64-(R1024_3_0))))
X15 ^= X00
X02 += X11
X11 = (((X11) << (R1024_3_1)) | ((X11) >> (64-(R1024_3_1))))
X11 ^= X02
X06 += X13
X13 = (((X13) << (R1024_3_2)) | ((X13) >> (64-(R1024_3_2))))
X13 ^= X06
X04 += X09
X09 = (((X09) << (R1024_3_3)) | ((X09) >> (64-(R1024_3_3))))
X09 ^= X04
X14 += X01
X01 = (((X01) << (R1024_3_4)) | ((X01) >> (64-(R1024_3_4))))
X01 ^= X14
X08 += X05
X05 = (((X05) << (R1024_3_5)) | ((X05) >> (64-(R1024_3_5))))
X05 ^= X08
X10 += X03
X03 = (((X03) << (R1024_3_6)) | ((X03) >> (64-(R1024_3_6))))
X03 ^= X10
X12 += X07
X07 = (((X07) << (R1024_3_7)) | ((X07) >> (64-(R1024_3_7))))
X07 ^= X12
X00 += ks[((2*(8))+ 1) % 17]
X01 += ks[((2*(8))+ 2) % 17]
X02 += ks[((2*(8))+ 3) % 17]
X03 += ks[((2*(8))+ 4) % 17]
X04 += ks[((2*(8))+ 5) % 17]
X05 += ks[((2*(8))+ 6) % 17]
X06 += ks[((2*(8))+ 7) % 17]
X07 += ks[((2*(8))+ 8) % 17]
X08 += ks[((2*(8))+ 9) % 17]
X09 += ks[((2*(8))+10) % 17]
X10 += ks[((2*(8))+11) % 17]
X11 += ks[((2*(8))+12) % 17]
X12 += ks[((2*(8))+13) % 17]
X13 += ks[((2*(8))+14) % 17] + kw[((2*(8))+1) % 3]
X14 += ks[((2*(8))+15) % 17] + kw[((2*(8))+2) % 3]
X15 += ks[((2*(8))+16) % 17] + (2*(8))+1
X00 += X01
X01 = (((X01) << (R1024_4_0)) | ((X01) >> (64-(R1024_4_0))))
X01 ^= X00
X02 += X03
X03 = (((X03) << (R1024_4_1)) | ((X03) >> (64-(R1024_4_1))))
X03 ^= X02
X04 += X05
X05 = (((X05) << (R1024_4_2)) | ((X05) >> (64-(R1024_4_2))))
X05 ^= X04
X06 += X07
X07 = (((X07) << (R1024_4_3)) | ((X07) >> (64-(R1024_4_3))))
X07 ^= X06
X08 += X09
X09 = (((X09) << (R1024_4_4)) | ((X09) >> (64-(R1024_4_4))))
X09 ^= X08
X10 += X11
X11 = (((X11) << (R1024_4_5)) | ((X11) >> (64-(R1024_4_5))))
X11 ^= X10
X12 += X13
X13 = (((X13) << (R1024_4_6)) | ((X13) >> (64-(R1024_4_6))))
X13 ^= X12
X14 += X15
X15 = (((X15) << (R1024_4_7)) | ((X15) >> (64-(R1024_4_7))))
X15 ^= X14
X00 += X09
X09 = (((X09) << (R1024_5_0)) | ((X09) >> (64-(R1024_5_0))))
X09 ^= X00
X02 += X13
X13 = (((X13) << (R1024_5_1)) | ((X13) >> (64-(R1024_5_1))))
X13 ^= X02
X06 += X11
X11 = (((X11) << (R1024_5_2)) | ((X11) >> (64-(R1024_5_2))))
X11 ^= X06
X04 += X15
X15 = (((X15) << (R1024_5_3)) | ((X15) >> (64-(R1024_5_3))))
X15 ^= X04
X10 += X07
X07 = (((X07) << (R1024_5_4)) | ((X07) >> (64-(R1024_5_4))))
X07 ^= X10
X12 += X03
X03 = (((X03) << (R1024_5_5)) | ((X03) >> (64-(R1024_5_5))))
X03 ^= X12
X14 += X05
X05 = (((X05) << (R1024_5_6)) | ((X05) >> (64-(R1024_5_6))))
X05 ^= X14
X08 += X01
X01 = (((X01) << (R1024_5_7)) | ((X01) >> (64-(R1024_5_7))))
X01 ^= X08
X00 += X07
X07 = (((X07) << (R1024_6_0)) | ((X07) >> (64-(R1024_6_0))))
X07 ^= X00
X02 += X05
X05 = (((X05) << (R1024_6_1)) | ((X05) >> (64-(R1024_6_1))))
X05 ^= X02
X04 += X03
X03 = (((X03) << (R1024_6_2)) | ((X03) >> (64-(R1024_6_2))))
X03 ^= X04
X06 += X01
X01 = (((X01) << (R1024_6_3)) | ((X01) >> (64-(R1024_6_3))))
X01 ^= X06
X12 += X15
X15 = (((X15) << (R1024_6_4)) | ((X15) >> (64-(R1024_6_4))))
X15 ^= X12
X14 += X13
X13 = (((X13) << (R1024_6_5)) | ((X13) >> (64-(R1024_6_5))))
X13 ^= X14
X08 += X11
X11 = (((X11) << (R1024_6_6)) | ((X11) >> (64-(R1024_6_6))))
X11 ^= X08
X10 += X09
X09 = (((X09) << (R1024_6_7)) | ((X09) >> (64-(R1024_6_7))))
X09 ^= X10
X00 += X15
X15 = (((X15) << (R1024_7_0)) | ((X15) >> (64-(R1024_7_0))))
X15 ^= X00
X02 += X11
X11 = (((X11) << (R1024_7_1)) | ((X11) >> (64-(R1024_7_1))))
X11 ^= X02
X06 += X13
X13 = (((X13) << (R1024_7_2)) | ((X13) >> (64-(R1024_7_2))))
X13 ^= X06
X04 += X09
X09 = (((X09) << (R1024_7_3)) | ((X09) >> (64-(R1024_7_3))))
X09 ^= X04
X14 += X01
X01 = (((X01) << (R1024_7_4)) | ((X01) >> (64-(R1024_7_4))))
X01 ^= X14
X08 += X05
X05 = (((X05) << (R1024_7_5)) | ((X05) >> (64-(R1024_7_5))))
X05 ^= X08
X10 += X03
X03 = (((X03) << (R1024_7_6)) | ((X03) >> (64-(R1024_7_6))))
X03 ^= X10
X12 += X07
X07 = (((X07) << (R1024_7_7)) | ((X07) >> (64-(R1024_7_7))))
X07 ^= X12
X00 += ks[((2*(8)+1)+ 1) % 17]
X01 += ks[((2*(8)+1)+ 2) % 17]
X02 += ks[((2*(8)+1)+ 3) % 17]
X03 += ks[((2*(8)+1)+ 4) % 17]
X04 += ks[((2*(8)+1)+ 5) % 17]
X05 += ks[((2*(8)+1)+ 6) % 17]
X06 += ks[((2*(8)+1)+ 7) % 17]
X07 += ks[((2*(8)+1)+ 8) % 17]
X08 += ks[((2*(8)+1)+ 9) % 17]
X09 += ks[((2*(8)+1)+10) % 17]
X10 += ks[((2*(8)+1)+11) % 17]
X11 += ks[((2*(8)+1)+12) % 17]
X12 += ks[((2*(8)+1)+13) % 17]
X13 += ks[((2*(8)+1)+14) % 17] + kw[((2*(8)+1)+1) % 3]
X14 += ks[((2*(8)+1)+15) % 17] + kw[((2*(8)+1)+2) % 3]
X15 += ks[((2*(8)+1)+16) % 17] + (2*(8)+1)+1
X00 += X01
X01 = (((X01) << (R1024_0_0)) | ((X01) >> (64-(R1024_0_0))))
X01 ^= X00
X02 += X03
X03 = (((X03) << (R1024_0_1)) | ((X03) >> (64-(R1024_0_1))))
X03 ^= X02
X04 += X05
X05 = (((X05) << (R1024_0_2)) | ((X05) >> (64-(R1024_0_2))))
X05 ^= X04
X06 += X07
X07 = (((X07) << (R1024_0_3)) | ((X07) >> (64-(R1024_0_3))))
X07 ^= X06
X08 += X09
X09 = (((X09) << (R1024_0_4)) | ((X09) >> (64-(R1024_0_4))))
X09 ^= X08
X10 += X11
X11 = (((X11) << (R1024_0_5)) | ((X11) >> (64-(R1024_0_5))))
X11 ^= X10
X12 += X13
X13 = (((X13) << (R1024_0_6)) | ((X13) >> (64-(R1024_0_6))))
X13 ^= X12
X14 += X15
X15 = (((X15) << (R1024_0_7)) | ((X15) >> (64-(R1024_0_7))))
X15 ^= X14
X00 += X09
X09 = (((X09) << (R1024_1_0)) | ((X09) >> (64-(R1024_1_0))))
X09 ^= X00
X02 += X13
X13 = (((X13) << (R1024_1_1)) | ((X13) >> (64-(R1024_1_1))))
X13 ^= X02
X06 += X11
X11 = (((X11) << (R1024_1_2)) | ((X11) >> (64-(R1024_1_2))))
X11 ^= X06
X04 += X15
X15 = (((X15) << (R1024_1_3)) | ((X15) >> (64-(R1024_1_3))))
X15 ^= X04
X10 += X07
X07 = (((X07) << (R1024_1_4)) | ((X07) >> (64-(R1024_1_4))))
X07 ^= X10
X12 += X03
X03 = (((X03) << (R1024_1_5)) | ((X03) >> (64-(R1024_1_5))))
X03 ^= X12
X14 += X05
X05 = (((X05) << (R1024_1_6)) | ((X05) >> (64-(R1024_1_6))))
X05 ^= X14
X08 += X01
X01 = (((X01) << (R1024_1_7)) | ((X01) >> (64-(R1024_1_7))))
X01 ^= X08
X00 += X07
X07 = (((X07) << (R1024_2_0)) | ((X07) >> (64-(R1024_2_0))))
X07 ^= X00
X02 += X05
X05 = (((X05) << (R1024_2_1)) | ((X05) >> (64-(R1024_2_1))))
X05 ^= X02
X04 += X03
X03 = (((X03) << (R1024_2_2)) | ((X03) >> (64-(R1024_2_2))))
X03 ^= X04
X06 += X01
X01 = (((X01) << (R1024_2_3)) | ((X01) >> (64-(R1024_2_3))))
X01 ^= X06
X12 += X15
X15 = (((X15) << (R1024_2_4)) | ((X15) >> (64-(R1024_2_4))))
X15 ^= X12
X14 += X13
X13 = (((X13) << (R1024_2_5)) | ((X13) >> (64-(R1024_2_5))))
X13 ^= X14
X08 += X11
X11 = (((X11) << (R1024_2_6)) | ((X11) >> (64-(R1024_2_6))))
X11 ^= X08
X10 += X09
X09 = (((X09) << (R1024_2_7)) | ((X09) >> (64-(R1024_2_7))))
X09 ^= X10
X00 += X15
X15 = (((X15) << (R1024_3_0)) | ((X15) >> (64-(R1024_3_0))))
X15 ^= X00
X02 += X11
X11 = (((X11) << (R1024_3_1)) | ((X11) >> (64-(R1024_3_1))))
X11 ^= X02
X06 += X13
X13 = (((X13) << (R1024_3_2)) | ((X13) >> (64-(R1024_3_2))))
X13 ^= X06
X04 += X09
X09 = (((X09) << (R1024_3_3)) | ((X09) >> (64-(R1024_3_3))))
X09 ^= X04
X14 += X01
X01 = (((X01) << (R1024_3_4)) | ((X01) >> (64-(R1024_3_4))))
X01 ^= X14
X08 += X05
X05 = (((X05) << (R1024_3_5)) | ((X05) >> (64-(R1024_3_5))))
X05 ^= X08
X10 += X03
X03 = (((X03) << (R1024_3_6)) | ((X03) >> (64-(R1024_3_6))))
X03 ^= X10
X12 += X07
X07 = (((X07) << (R1024_3_7)) | ((X07) >> (64-(R1024_3_7))))
X07 ^= X12
X00 += ks[((2*(9))+ 1) % 17]
X01 += ks[((2*(9))+ 2) % 17]
X02 += ks[((2*(9))+ 3) % 17]
X03 += ks[((2*(9))+ 4) % 17]
X04 += ks[((2*(9))+ 5) % 17]
X05 += ks[((2*(9))+ 6) % 17]
X06 += ks[((2*(9))+ 7) % 17]
X07 += ks[((2*(9))+ 8) % 17]
X08 += ks[((2*(9))+ 9) % 17]
X09 += ks[((2*(9))+10) % 17]
X10 += ks[((2*(9))+11) % 17]
X11 += ks[((2*(9))+12) % 17]
X12 += ks[((2*(9))+13) % 17]
X13 += ks[((2*(9))+14) % 17] + kw[((2*(9))+1) % 3]
X14 += ks[((2*(9))+15) % 17] + kw[((2*(9))+2) % 3]
X15 += ks[((2*(9))+16) % 17] + (2*(9))+1
X00 += X01
X01 = (((X01) << (R1024_4_0)) | ((X01) >> (64-(R1024_4_0))))
X01 ^= X00
X02 += X03
X03 = (((X03) << (R1024_4_1)) | ((X03) >> (64-(R1024_4_1))))
X03 ^= X02
X04 += X05
X05 = (((X05) << (R1024_4_2)) | ((X05) >> (64-(R1024_4_2))))
X05 ^= X04
X06 += X07
X07 = (((X07) << (R1024_4_3)) | ((X07) >> (64-(R1024_4_3))))
X07 ^= X06
X08 += X09
X09 = (((X09) << (R1024_4_4)) | ((X09) >> (64-(R1024_4_4))))
X09 ^= X08
X10 += X11
X11 = (((X11) << (R1024_4_5)) | ((X11) >> (64-(R1024_4_5))))
X11 ^= X10
X12 += X13
X13 = (((X13) << (R1024_4_6)) | ((X13) >> (64-(R1024_4_6))))
X13 ^= X12
X14 += X15
X15 = (((X15) << (R1024_4_7)) | ((X15) >> (64-(R1024_4_7))))
X15 ^= X14
X00 += X09
X09 = (((X09) << (R1024_5_0)) | ((X09) >> (64-(R1024_5_0))))
X09 ^= X00
X02 += X13
X13 = (((X13) << (R1024_5_1)) | ((X13) >> (64-(R1024_5_1))))
X13 ^= X02
X06 += X11
X11 = (((X11) << (R1024_5_2)) | ((X11) >> (64-(R1024_5_2))))
X11 ^= X06
X04 += X15
X15 = (((X15) << (R1024_5_3)) | ((X15) >> (64-(R1024_5_3))))
X15 ^= X04
X10 += X07
X07 = (((X07) << (R1024_5_4)) | ((X07) >> (64-(R1024_5_4))))
X07 ^= X10
X12 += X03
X03 = (((X03) << (R1024_5_5)) | ((X03) >> (64-(R1024_5_5))))
X03 ^= X12
X14 += X05
X05 = (((X05) << (R1024_5_6)) | ((X05) >> (64-(R1024_5_6))))
X05 ^= X14
X08 += X01
X01 = (((X01) << (R1024_5_7)) | ((X01) >> (64-(R1024_5_7))))
X01 ^= X08
X00 += X07
X07 = (((X07) << (R1024_6_0)) | ((X07) >> (64-(R1024_6_0))))
X07 ^= X00
X02 += X05
X05 = (((X05) << (R1024_6_1)) | ((X05) >> (64-(R1024_6_1))))
X05 ^= X02
X04 += X03
X03 = (((X03) << (R1024_6_2)) | ((X03) >> (64-(R1024_6_2))))
X03 ^= X04
X06 += X01
X01 = (((X01) << (R1024_6_3)) | ((X01) >> (64-(R1024_6_3))))
X01 ^= X06
X12 += X15
X15 = (((X15) << (R1024_6_4)) | ((X15) >> (64-(R1024_6_4))))
X15 ^= X12
X14 += X13
X13 = (((X13) << (R1024_6_5)) | ((X13) >> (64-(R1024_6_5))))
X13 ^= X14
X08 += X11
X11 = (((X11) << (R1024_6_6)) | ((X11) >> (64-(R1024_6_6))))
X11 ^= X08
X10 += X09
X09 = (((X09) << (R1024_6_7)) | ((X09) >> (64-(R1024_6_7))))
X09 ^= X10
X00 += X15
X15 = (((X15) << (R1024_7_0)) | ((X15) >> (64-(R1024_7_0))))
X15 ^= X00
X02 += X11
X11 = (((X11) << (R1024_7_1)) | ((X11) >> (64-(R1024_7_1))))
X11 ^= X02
X06 += X13
X13 = (((X13) << (R1024_7_2)) | ((X13) >> (64-(R1024_7_2))))
X13 ^= X06
X04 += X09
X09 = (((X09) << (R1024_7_3)) | ((X09) >> (64-(R1024_7_3))))
X09 ^= X04
X14 += X01
X01 = (((X01) << (R1024_7_4)) | ((X01) >> (64-(R1024_7_4))))
X01 ^= X14
X08 += X05
X05 = (((X05) << (R1024_7_5)) | ((X05) >> (64-(R1024_7_5))))
X05 ^= X08
X10 += X03
X03 = (((X03) << (R1024_7_6)) | ((X03) >> (64-(R1024_7_6))))
X03 ^= X10
X12 += X07
X07 = (((X07) << (R1024_7_7)) | ((X07) >> (64-(R1024_7_7))))
X07 ^= X12
X00 += ks[((2*(9)+1)+ 1) % 17]
X01 += ks[((2*(9)+1)+ 2) % 17]
X02 += ks[((2*(9)+1)+ 3) % 17]
X03 += ks[((2*(9)+1)+ 4) % 17]
X04 += ks[((2*(9)+1)+ 5) % 17]
X05 += ks[((2*(9)+1)+ 6) % 17]
X06 += ks[((2*(9)+1)+ 7) % 17]
X07 += ks[((2*(9)+1)+ 8) % 17]
X08 += ks[((2*(9)+1)+ 9) % 17]
X09 += ks[((2*(9)+1)+10) % 17]
X10 += ks[((2*(9)+1)+11) % 17]
X11 += ks[((2*(9)+1)+12) % 17]
X12 += ks[((2*(9)+1)+13) % 17]
X13 += ks[((2*(9)+1)+14) % 17] + kw[((2*(9)+1)+1) % 3]
X14 += ks[((2*(9)+1)+15) % 17] + kw[((2*(9)+1)+2) % 3]
X15 += ks[((2*(9)+1)+16) % 17] + (2*(9)+1)+1
s.X[ 0] = X00 ^ w[ 0]
s.X[ 1] = X01 ^ w[ 1]
s.X[ 2] = X02 ^ w[ 2]
s.X[ 3] = X03 ^ w[ 3]
s.X[ 4] = X04 ^ w[ 4]
s.X[ 5] = X05 ^ w[ 5]
s.X[ 6] = X06 ^ w[ 6]
s.X[ 7] = X07 ^ w[ 7]
s.X[ 8] = X08 ^ w[ 8]
s.X[ 9] = X09 ^ w[ 9]
s.X[10] = X10 ^ w[10]
s.X[11] = X11 ^ w[11]
s.X[12] = X12 ^ w[12]
s.X[13] = X13 ^ w[13]
s.X[14] = X14 ^ w[14]
s.X[15] = X15 ^ w[15]
kw[1] &= ^(uint64( 1 ) << ((126) - 64))
//blkPtr += ( 8*(16))
blk = blk[8*16:]
}
s.h.T[0] = kw[0]
s.h.T[1] = kw[1]
}