tango.util.cipher.Cipher

License:

BSD style: see license.txt

Authors:

Thomas Dixon
class Cipher [abstract] #
Base symmetric cipher class
uint update(void[] input_, void[] output_) [abstract] #
Process a block of plaintext data from the input array and place it in the output array.

Params:

input_Array containing input data.
output_Array to hold the output data.

Returns:

The amount of encrypted data processed.
string name() [abstract] #

Returns:

The name of the algorithm of this cipher.
void reset() [abstract] #
Reset cipher to its state immediately subsequent the last init.
void invalid(char[] msg) [static] #
throw an InvalidArgument exception

Params:

msgmessage to associate with the exception
bool initialized() [final] #

Returns:

Whether or not the cipher has been initialized.
class BlockCipher : Cipher [abstract] #
Interface for a standard block cipher.
uint blockSize() [abstract] #

Returns:

The block size in bytes that this cipher will operate on.
class StreamCipher : Cipher [abstract] #
Interface for a standard stream cipher.
ubyte returnByte(ubyte input) [abstract] #
Process one byte of input.

Params:

inputByte to XOR with keystream.

Returns:

One byte of input XORed with the keystream.
class BlockCipherPadding [abstract] #
Base padding class for implementing block padding schemes.
string name() [abstract] #

Returns:

The name of the padding scheme implemented.
ubyte[] pad(uint len) [abstract] #
Generate padding to a specific length.

Params:

lenLength of padding to generate

Returns:

The padding bytes to be added.
uint unpad(void[] input_) [abstract] #
Return the number of pad bytes in the block.

Params:

input_Padded block of which to count the pad bytes.

Returns:

The number of pad bytes in the block.

Throws:

dcrypt.crypto.errors.InvalidPaddingError if pad length cannot be discerned.
struct ByteConverter #
Converts between integral types and unsigned byte arrays
struct LittleEndian #
Conversions between little endian integrals and bytes
T to(T)(void[] x_) [static] #
Converts the supplied array to integral type T

Params:

x_The supplied array of bytes (ubytes, bytes, chars, whatever)

Returns:

A integral of type T created with the supplied bytes placed in the specified byte order.
void from(T)(T input, ubyte[] output) [static] #
Converts the supplied integral to an array of unsigned bytes.

Params:

inputIntegral to convert to bytes

Returns:

Integral input of type T split into its respective bytes with the bytes placed in the specified byte order.
struct BigEndian #
Conversions between big endian integrals and bytes