Twofish-0.1: An implementation of the Twofish Symmetric-key cipher.Source codeContentsIndex
Codec.Encryption.Twofish
Contents
Classes
Types
Functions
Curiosities
Description

Implements the Twofish symmetric block cipher, designed by: Bruce Schneier, John Kelsey, Doug Whiting, David Wagner, Chris Hall, and Niels Ferguson.

Implemented from the paper entitled Twofish: A 128-Bit Block Cipher, http://www.counterpane.com/twofish.html with help from the reference C implementation.

This module provides two methods for constructiong a Twofish cipher from a 128, 192 or 256 bit key. The mkCipher function allows you to customize the number of rounds, while the mkStdCipher function gives you the standard 16 rounds.

Synopsis
class (Bits a, Integral a) => Key a
data TwofishCipher
mkStdCipher :: Key a => a -> TwofishCipher
mkCipher :: Key a => Int -> a -> TwofishCipher
q0o :: Word8 -> Word8
q1o :: Word8 -> Word8
Classes
class (Bits a, Integral a) => Key a Source
A key is a vector of bytes of a certain size (given in bits). Twofish suppports key sizes of 128, 192, and 256 bits.
show/hide Instances
Types
data TwofishCipher Source
A keyed Twofish cipher capable of both encryption and decryption.
show/hide Instances
Functions
mkStdCipher :: Key a => a -> TwofishCipherSource
Constructs a standard Twofish cipher from the given key
mkCipher :: Key a => Int -> a -> TwofishCipherSource
Constructs an encryption/decryption cipher from the given key, and a given number of rounds (standard Twofish uses 16 rounds)
Curiosities
q0o :: Word8 -> Word8Source
Generates the q0 byte vector using the algorithm specified in the Twofish paper. This function isn't used by the cipher; instead the pre-computed array is contained in the code.
q1o :: Word8 -> Word8Source
Generates the q1 byte vector using the algorithm specified in the Twofish paper. This function isn't used by the cipher; instead the pre-computed array is contained in the code.
Produced by Haddock version 2.6.1