jonelo.jacksum.adapt.gnu.crypto.hash
Class MD2
BaseHash
jonelo.jacksum.adapt.gnu.crypto.hash.MD2
public class MD2
extends BaseHash
An implementation of the MD2 message digest algorithm.
MD2 is not widely used. Unless it is needed for compatibility with
existing systems, it is not recommended for use in new applications.
References:
- The MD2
Message-Digest Algorithm.
B. Kaliski. - The RFC ERRATA PAGE
under section RFC 1319.
MD2() - Creates a new MD2 digest ready for use.
|
MD2
public MD2()
Creates a new MD2 digest ready for use.
clone
public Object clone()
getResult
protected byte[] getResult()
padBuffer
protected byte[] padBuffer()
Generates an array of padding bytes. The padding is defined as
i
bytes of value i
, where i
is the
number of bytes to fill the last block of the message to
BLOCK_LENGTH
bytes (or BLOCK_LENGTH
bytes when
the last block was completely full).
- the bytes to pad the remaining bytes in the buffer before
completing a hash operation.
resetContext
protected void resetContext()
selfTest
public boolean selfTest()
transform
protected void transform(byte[] in,
int off)
Adds BLOCK_LENGTH
bytes to the running digest.
in
- the byte array to take the BLOCK_LENGTH
bytes from.off
- the offset to start from in the given byte array.