threefish

package module
v0.0.0-...-3ecf4c4 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2012 License: BSD-2-Clause Imports: 1 Imported by: 18

README

Go implementation of Threefish-512 block cipher.

Documentation

Overview

Package threefish implements Threefish-512 block cipher as defined in "The Skein Hash Function Family" paper version 1.3.

Index

Constants

View Source
const (
	// Block size in bytes.
	BlockSize = 64
	// Key size in bytes.
	KeySize = 64
	// Tweak size in bytes.
	TweakSize = 16
)

Variables

This section is empty.

Functions

func DecryptBlock

func DecryptBlock(key, tweak, dst, src []byte)

DecryptBlock decrypts a single block with the given key and tweak.

func EncryptBlock

func EncryptBlock(key, tweak, dst, src []byte)

EncryptBlock encrypts a single block with the given key and tweak.

Types

type KeySizeError

type KeySizeError int

func (KeySizeError) Error

func (k KeySizeError) Error() string

type Threefish

type Threefish struct {
	// contains filtered or unexported fields
}

Threefish is an instance of cipher using a particular key and tweak.

func NewCipher

func NewCipher(key []byte, tweak []byte) (*Threefish, error)

NewCipher creates and returns a new Threefish cipher, compatible with cipher.Block interface. The key argument must be 64 bytes, tweak - 16 bytes.

func (*Threefish) BlockSize

func (c *Threefish) BlockSize() int

func (*Threefish) Decrypt

func (c *Threefish) Decrypt(dst, src []byte)

func (*Threefish) Encrypt

func (c *Threefish) Encrypt(dst, src []byte)

func (*Threefish) SetTweak

func (c *Threefish) SetTweak(tweak []byte) error

SetTweak changes the tweak for Threefish cipher to the given value.

type TweakSizeError

type TweakSizeError int

func (TweakSizeError) Error

func (t TweakSizeError) Error() string

Jump to

Keyboard shortcuts

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