| uk.org.ponder.hashutil.MessageDigestSpi uk.org.ponder.hashutil.PaddingMD
All known Subclasses: uk.org.ponder.hashutil.SHA,
PaddingMD | abstract class PaddingMD extends MessageDigestSpi (Code) | | This abstract class implements the MD4-like block/padding structure as it is
used by most hashes (MD4, MD5, SHA-0, SHA-1, RIPEMD-128, RIPEMD-160, Tiger).
This class handles the message buffering, bit counting and padding.
Subclasses need implement only the three abstract functions to create a
working hash.
This class has three padding modes: MD5-like, SHA-like and Tiger-like.
This applies to the padding and encoding of the 64-bit length counter.
version: Revision: 1.8 author: Jeroen C. van Gelderen (gelderen@cryptix.org) |
Constructor Summary | |
protected | PaddingMD(int hashSize, int mode) Construct a 64-byte PaddingMD in MD-like, SHA-like or Tiger-like
padding mode. | protected | PaddingMD(int blockSize, int hashSize, int mode) Construct a 64 or 128-byte PaddingMD in MD-like, SHA-like or Tiger-like
padding mode. | protected | PaddingMD(PaddingMD src) |
Method Summary | |
public Object | clone() | abstract protected void | coreDigest(byte[] buf, int off) Return the hash bytes in buf , starting at offset
off .
The subclass is expected to write exactly hashSize bytes
in the given buffer. | abstract protected void | coreReset() Reset the hash internal structures to initial state. | abstract protected void | coreUpdate(byte[] buf, int off) Update the internal state with a single block. | protected byte[] | engineDigest() | protected int | engineDigest(byte[] buf, int offset, int len) | protected int | engineGetDigestLength() | protected void | engineReset() | protected void | engineUpdate(byte input) | protected void | engineUpdate(byte[] input, int offset, int length) |
MODE_MDMODE_SHAMODE_TIGER | final static int MODE_MDMODE_SHAMODE_TIGER(Code) | | |
PaddingMD | protected PaddingMD(int hashSize, int mode)(Code) | | Construct a 64-byte PaddingMD in MD-like, SHA-like or Tiger-like
padding mode.
The subclass must call this constructor, giving the length of its hash
in bytes.
Parameters: hashSize - Length of the hash in bytes. |
PaddingMD | protected PaddingMD(int blockSize, int hashSize, int mode)(Code) | | Construct a 64 or 128-byte PaddingMD in MD-like, SHA-like or Tiger-like
padding mode.
Parameters: hashSize - Length of the hash in bytes. |
coreDigest | abstract protected void coreDigest(byte[] buf, int off)(Code) | | Return the hash bytes in buf , starting at offset
off .
The subclass is expected to write exactly hashSize bytes
in the given buffer. The buffer is guaranteed to be large enough.
|
coreReset | abstract protected void coreReset()(Code) | | Reset the hash internal structures to initial state.
|
coreUpdate | abstract protected void coreUpdate(byte[] buf, int off)(Code) | | Update the internal state with a single block.
buf contains a single block (64 bytes, 512 bits) of data,
starting at offset off .
|
engineDigest | protected byte[] engineDigest()(Code) | | |
engineGetDigestLength | protected int engineGetDigestLength()(Code) | | |
engineReset | protected void engineReset()(Code) | | |
engineUpdate | protected void engineUpdate(byte input)(Code) | | |
engineUpdate | protected void engineUpdate(byte[] input, int offset, int length)(Code) | | |
|
|