gnu.crypto.hash
Class MD2
- Cloneable, IMessageDigest
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.
|
Object | clone() - Returns a clone copy of this instance.
|
protected byte[] | getResult() - Constructs the result from the contents of the current context.
|
protected byte[] | padBuffer() - Generates an array of padding bytes.
|
protected void | resetContext() - Resets the instance for future re-use.
|
boolean | selfTest() - A basic test.
|
protected void | transform(byte[] in, int off) - Adds
BLOCK_LENGTH bytes to the running digest.
|
blockSize , clone , digest , getResult , hashSize , name , padBuffer , reset , resetContext , selfTest , transform , update , update , update |
MD2
public MD2()
Creates a new MD2 digest ready for use.
getResult
protected byte[] getResult()
Constructs the result from the contents of the current context.
- getResult in interface BaseHash
- the output of the completed hash operation.
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).
- padBuffer in interface BaseHash
- the bytes to pad the remaining bytes in the buffer before
completing a hash operation.
resetContext
protected void resetContext()
Resets the instance for future re-use.
- resetContext in interface BaseHash
selfTest
public boolean selfTest()
A basic test. Ensures that the digest of a pre-determined message is equal
to a known pre-computed value.
- selfTest in interface IMessageDigest
- selfTest in interface BaseHash
- true if the implementation passes a basic self-test.
Returns false otherwise.
transform
protected void transform(byte[] in,
int off)
Adds BLOCK_LENGTH
bytes to the running digest.
- transform in interface BaseHash
in
- the byte array to take the BLOCK_LENGTH
bytes from.off
- the offset to start from in the given byte array.
Copyright © 2001, 2002, 2003
Free Software Foundation,
Inc. All Rights Reserved.