tango.util.digest.Md2

License:

BSD style: see doc/license.txt for details

Version:

Initial release: Feb 2006

Author:

Regan Heath, Oskar Linde

This module implements the MD2 Message Digest Algorithm as described by RFC 1319 The MD2 Message-Digest Algorithm. B. Kaliski. April 1992.
class Md2 : MerkleDamgard
this()
Construct an Md2
void reset() [protected, override]
Initialize the cipher

Remarks:

Returns the cipher state to it's initial value
void createDigest(ubyte[] buf) [protected, override]
Obtain the digest

Returns:

the digest

Remarks:

Returns a digest of the current cipher state, this may be the final digest, or a digest of the state between calls to update()
uint digestSize() [override]
The MD 2 digest size is 16 bytes
uint blockSize() [protected, override]
block size

Returns:

the block size

Remarks:

Specifies the size (in bytes) of the block of data to pass to each call to transform(). For MD2 the blockSize is 16.
uint addSize() [protected, override]
Length padding size

Returns:

the length padding size

Remarks:

Specifies the size (in bytes) of the padding which uses the length of the data which has been ciphered, this padding is carried out by the padLength method. For MD2 the addSize is 0
void padMessage(ubyte[] data) [protected, override]
Pads the cipher data

Parameters:

dataa slice of the cipher buffer to fill with padding

Remarks:

Fills the passed buffer slice with the appropriate padding for the final call to transform(). This padding will fill the cipher buffer up to blockSize()-addSize().
void transform(const(ubyte[]) input) [protected, override]
Performs the cipher on a block of data

Parameters:

datathe block of data to cipher

Remarks:

The actual cipher algorithm is carried out by this method on the passed block of data. This method is called for every blockSize() bytes of input data and once more with the remaining data padded to blockSize().
void extend() [protected, override]
Final processing of cipher.

Remarks:

This method is called after the final transform just prior to the creation of the final digest. The MD2 algorithm requires an additional step at this stage. Future ciphers may or may not require this method.