threefish

package
v1.0.2057 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 3 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 New1024

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

New1024 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 New256

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

New256 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 New512

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

New512 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.

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