iaik.security.md
Class RawHash

java.lang.Object
  |
  +--iaik.security.md.RawHash
All Implemented Interfaces:
Cloneable

public class RawHash
extends Object
implements Cloneable

This class makes the compression function of a hash algorithm accessible. For example the FIP 186 pseudo random generator uses this class to access the compression function.

Version:
File Revision 5

Constructor Summary
RawHash(iaik.security.md.AbstractMessageDigest delegate)
          Create a new raw hash function that provides the compression function of the given complete hash function.
 
Method Summary
 Object clone()
          Create a clone of this object which has the same internal states.
 byte[] compress(byte[] input)
          Apply the compression function to given input block.
 int getBlockSize()
          Get the input blocksize of this hash function in bytes.
 int getDigetLegnth()
          Get the output length of this hash in bytes.
 void reset()
          Reset this hash function.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RawHash

public RawHash(iaik.security.md.AbstractMessageDigest delegate)
Create a new raw hash function that provides the compression function of the given complete hash function.
Parameters:
delegate - The underlying complete hash function which provides the compression function.
Method Detail

compress

public byte[] compress(byte[] input)
Apply the compression function to given input block. The input block must have the input blocksize of the hash function. This method does not apply any padding. The hash is not reset after this call; the applcation can do this manually.
Parameters:
input - The input block to feed into the compression.
Returns:
The output of the compression function. This will have the length of the hash.
See Also:
getBlockSize(), reset()

reset

public void reset()
Reset this hash function. This deletes any internal states.

getBlockSize

public int getBlockSize()
Get the input blocksize of this hash function in bytes.
Returns:
The blocksize in bytes; e.g. 64 for SHA-1.

getDigetLegnth

public int getDigetLegnth()
Get the output length of this hash in bytes.
Returns:
The hash length; e.g. 20 for SHA-1.

clone

public Object clone()
Create a clone of this object which has the same internal states. The clone can operate completely independent; i.e. it is a deep clone.
Overrides:
clone in class Object

This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note).

IAIK-JCE 3.1 with IAIK-JCE CC Core 3.1, (c) 1997-2004 IAIK