License:
BSD style: see doc/license.txt for details
Version:
Initial release: Feb 2006
author:
Regan Heath, Oskar Linde
This module implements the SHA-512 Algorithm described by Secure
Hash Standard, FIPS PUB 180-2
class Sha512: tango.util.digest.MerkleDamgard.MerkleDamgard;
this();
Construct a Sha512 hash algorithm context
protected void createDigest(ubyte[] buf);
uint digestSize();
The digest size of Sha-512 is 64 bytes
protected void reset();
Initialize the cipher
Remarks:
Returns the cipher state to it's initial value
protected uint blockSize();
Cipher 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 SHA512 the blockSize is 128.
protected uint addSize();
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 SHA512 the addSize is 16.
protected void padMessage(ubyte[] data);
Pads the cipher data
Params:
ubyte[] data
a 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().
the slice of the cipher buffer to fill with padding
ulong length
the length of the data which has been ciphered
Remarks:
Fills the passed buffer slice with addSize() bytes of padding
based on the length in bytes of the input data which has been
ciphered.
protected void transform(const(ubyte[]) input);
Performs the cipher on a block of data
Params:
data
the 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().
Page generated by Ddoc. Copyright (c) 2006 Tango. All rights reserved