License:
BSD style: see doc/license.txt for detailsVersion:
Initial release: Feb 2006Author:
Regan Heath, Oskar Linde This module implements a generic Merkle-Damgard hash function
1 2 3 4 5 6 7 | public uint digestSize(); protected void reset(); protected void createDigest(ubyte[] buf); protected uint blockSize(); protected uint addSize(); protected void padMessage(ubyte[] data); protected void transform(ubyte[] data); |
required:
1 2 | protected abstract void padLength(ubyte[] data, ulong length); protected abstract void extend(); |
Params:
buf | a buffer with enough space to hold the digest |
Remarks:
Constructs the digest.Returns:
the block sizeRemarks:
Specifies the size (in bytes) of the block of data to pass to each call to transform().Returns:
the length padding sizeRemarks:
Specifies the size (in bytes) of the padding which uses the length of the data which has been fed to the algorithm, this padding is carried out by the padLength method.Params:
data | a slice of the digest 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 message data buffer up to blockSize()-addSize().Params:
data | the slice of the digest buffer to fill with padding |
length | the length of the data which has been processed |
Remarks:
Fills the passed buffer slice with addSize() bytes of padding based on the length in bytes of the input data which has been processed.Params:
data | the block of data to digest |
Remarks:
The actual digest 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().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 digests may or may not require this method.Remarks:
Constructs the internal buffer for use by the digest, the buffer size (in bytes) is defined by the abstract method blockSize().Remarks:
Returns the digest state to its initial valueParams:
input | the data to digest |
Remarks:
Continues the digest operation on the additional data.Returns:
the completed digestRemarks:
Concludes the algorithm producing the final digest.Params:
input | the source array |
output | the destination array |
Remarks:
Converts an array of ubyte[] into uint[] in Little Endian byte order.Params:
input | the source array |
output | the destination array |
Remarks:
Converts an array of ubyte[] into uint[] in Big Endian byte order.Params:
input | the source array |
output | the destination array |
Remarks:
Converts an array of ubyte[] into ulong[] in Little Endian byte order.Params:
input | the source array |
output | the destination array |
Remarks:
Converts an array of ubyte[] into ulong[] in Big Endian byte order.Params:
x | the value to rotate |
n | the amount to rotate by |
Remarks:
Rotates a 32 bit value by the specified amount.