func NewSize(size int) (*Cipher, error) {
    var err error
    var internal cipherInternal
    switch size {
    case 256:
        internal, err = newThreefish256(nil, nil)
    case 512:
        internal, err = newThreefish512(nil, nil)
    case 1024:
        internal, err = newThreefish1024(nil, nil)
    default:
        return nil, KeySizeError(size)
    }
    return &Cipher{size, internal}, err
}
NewSize creates and returns a Cipher.

The size argument is the requested Threefish state size
which is also the key and block size. Supported sizes see constants section.
package threefish
import (
    "strconv"
    "encoding/binary"
)
const (
    KEY_SCHEDULE_CONST  = uint64(0x1BD11BDAA9FC1A22)
    EXPANDED_TWEAK_SIZE = 3
)
type cipherInternal interface {
    encrypt(input, output []uint64)
    decrypt(input, output []uint64)
    getTempData() ([]uint64, []uint64)
    setTweak(tweak []uint64)
    setKey(key []uint64)
}
type Cipher struct {
    stateSize int
    cipherInternal
}
type KeySizeError int
func (k KeySizeError) Error() string {
    return "crypto/threefish: invalid key size " + strconv.Itoa(int(k))
}
func New(key []byte, tweak []uint64) (*Cipher, error) {
    var err error
    var internal cipherInternal
    switch len(key) {
    case 32:
        internal, err = newThreefish256(key, tweak)
    case 64:
        internal, err = newThreefish512(key, tweak)
    case 128:
        internal, err = newThreefish1024(key, tweak)
    default:
        return nil, KeySizeError(len(key))
    }
    return &Cipher{len(key) * 8, internal}, err
}
func New64(key, tweak []uint64) (*Cipher, error) {
    var err error
    var internal cipherInternal
    switch len(key) {
    case 4:
        internal, err = newThreefish256_64(key, tweak)
    case 8:
        internal, err = newThreefish512_64(key, tweak)
    case 16:
        internal, err = newThreefish1024_64(key, tweak)
    default:
        return nil, KeySizeError(len(key))
    }
    return &Cipher{len(key) * 8, internal}, err
}