Documentation ¶
Overview ¶
Package threefish implements the Threefish tweakable block cipher.
Index ¶
- Constants
- func GETU64(ptr []byte) uint64
- func NewCipher(key, tweak []byte) (cipher.Block, error)
- func NewCipher1024(key, tweak []byte) (cipher.Block, error)
- func NewCipher256(key, tweak []byte) (cipher.Block, error)
- func NewCipher512(key, tweak []byte) (cipher.Block, error)
- func PUTU64(ptr []byte, a uint64)
- type KeySizeError
- type TweakSizeError
Constants ¶
const (
// Size of a 1024-bit block in bytes
BlockSize1024 = 128
)
const (
// Size of a 256-bit block in bytes
BlockSize256 = 32
)
const (
// Size of a 512-bit block in bytes
BlockSize512 = 64
)
Variables ¶
This section is empty.
Functions ¶
func NewCipher ¶ added in v1.0.2060
NewCipher creates and returns a new cipher.Block. data bytes use BigEndian
func NewCipher1024 ¶ added in v1.0.2060
NewCipher1024 creates a new Threefish cipher with a block size of 1024 bits. The key argument must be 64 bytes and the tweak argument must be 16 bytes.
func NewCipher256 ¶ added in v1.0.2060
NewCipher256 creates a new Threefish cipher with a block size of 256 bits. The key argument must be 32 bytes and the tweak argument must be 16 bytes.
func NewCipher512 ¶ added in v1.0.2060
NewCipher512 creates a new Threefish cipher with a block size of 512 bits. The key argument must be 64 bytes and the tweak argument must be 16 bytes.
Types ¶
type KeySizeError ¶
type KeySizeError int
A KeySizeError is returned when the provided key isn't the correct size.
type TweakSizeError ¶
type TweakSizeError struct{}
A TweakSizeError is returned when the provided tweak isn't the correct size.
func (TweakSizeError) Error ¶
func (e TweakSizeError) Error() string
Error describes a TweakSizeError.