func newThreefish512_64(key, tweak []uint64) (*threefish512, error) {
    c := new(threefish512)
    setTweak(tweak, c.expanedTweak[:])
    c.expanedKey[EXPANDED_KEY_SIZE_512-1] = KEY_SCHEDULE_CONST
    setKey(key, c.expanedKey[:])
    return c, nil
}
Get an initialized Threefish512 structure
package threefish
import (
    "encoding/binary"
)
const (
    CIPHER_SIZE_512       = 512
    CIPHER_QWORDS_512     = CIPHER_SIZE_512 / 64
    EXPANDED_KEY_SIZE_512 = CIPHER_QWORDS_512 + 1
)
type threefish512 struct {
    expanedTweak       [EXPANDED_TWEAK_SIZE]uint64
    expanedKey         [EXPANDED_KEY_SIZE_512]uint64
    tmpData1, tmpData2 [CIPHER_QWORDS_512]uint64
}
func newThreefish512(key []byte, tweak []uint64) (*threefish512, error) {
    c := new(threefish512)
    setTweak(tweak, c.expanedTweak[:])
    c.expanedKey[EXPANDED_KEY_SIZE_512-1] = KEY_SCHEDULE_CONST
    if key != nil {
        var tmpkey [EXPANDED_KEY_SIZE_512]uint64
        for i := 0; i < EXPANDED_KEY_SIZE_512-1; i++ {
            tmpkey[i] = binary.LittleEndian.Uint64(key[i*8 : i*8+8])
        }
        setKey(tmpkey[:], c.expanedKey[:])
    }
    return c, nil
}