threefish

package
v1.0.4002 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package threefish implements the Threefish tweakable block cipher.

Index

Constants

View Source
const (
	// Size of a 1024-bit block in bytes
	BlockSize1024 = 128
)
View Source
const (
	// Size of a 256-bit block in bytes
	BlockSize256 = 32
)
View Source
const (
	// Size of a 512-bit block in bytes
	BlockSize512 = 64
)

Variables

This section is empty.

Functions

func GETU64 added in v1.0.2060

func GETU64(ptr []byte) uint64

func NewCipher added in v1.0.2060

func NewCipher(key, tweak []byte) (cipher.Block, error)

NewCipher creates and returns a new cipher.Block. data bytes use BigEndian

func NewCipher1024 added in v1.0.2060

func NewCipher1024(key, tweak []byte) (cipher.Block, error)

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

func NewCipher256(key, tweak []byte) (cipher.Block, error)

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

func NewCipher512(key, tweak []byte) (cipher.Block, error)

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.

func PUTU64 added in v1.0.2060

func PUTU64(ptr []byte, a uint64)

Types

type KeySizeError

type KeySizeError int

A KeySizeError is returned when the provided key isn't the correct size.

func (KeySizeError) Error

func (e KeySizeError) Error() string

Error describes a KeySizeError.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL