com.ibm.crypto.provider
Class SHA

java.lang.Object
  extended by java.security.MessageDigestSpi
      extended by com.ibm.crypto.provider.SHA
All Implemented Interfaces:
Cloneable

public final class SHA
extends MessageDigestSpi
implements Cloneable

This class implements the Secure Hash Algorithm (SHA) developed by the National Institute of Standards and Technology along with the National Security Agency. This is the updated version of SHA fip-180 as superseded by fip-180-1.


Constructor Summary
SHA()
          Standard constructor, creates a new SHA instance, allocates its buffers from the heap.
 
Method Summary
 Object clone()
          Clones this object.
protected  byte[] engineDigest()
           
protected  int engineDigest(byte[] buf, int offset, int len)
           
protected  int engineGetDigestLength()
          Return the digest length in bytes
protected  void engineReset()
           
protected  void engineUpdate(byte b)
          Update adds the passed byte to the digested data.
protected  void engineUpdate(byte[] input, int offset, int len)
          Update adds the selected part of an array of bytes to the digest.
 void init()
          Initialize the SHA information
 
Methods inherited from class java.security.MessageDigestSpi
engineUpdate
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SHA

public SHA()
Standard constructor, creates a new SHA instance, allocates its buffers from the heap.

Method Detail

init

public void init()
Initialize the SHA information


engineReset

protected void engineReset()
Specified by:
engineReset in class MessageDigestSpi

engineGetDigestLength

protected int engineGetDigestLength()
Return the digest length in bytes

Overrides:
engineGetDigestLength in class MessageDigestSpi

engineUpdate

protected void engineUpdate(byte b)
Update adds the passed byte to the digested data.

Specified by:
engineUpdate in class MessageDigestSpi

engineUpdate

protected void engineUpdate(byte[] input,
                            int offset,
                            int len)
Update adds the selected part of an array of bytes to the digest. This version is more efficient than the byte-at-a-time version; it avoids data copies and reduces per-byte call overhead.

Specified by:
engineUpdate in class MessageDigestSpi

engineDigest

protected byte[] engineDigest()
Specified by:
engineDigest in class MessageDigestSpi

engineDigest

protected int engineDigest(byte[] buf,
                           int offset,
                           int len)
                    throws DigestException
Overrides:
engineDigest in class MessageDigestSpi
Throws:
DigestException

clone

public Object clone()
Clones this object.

Overrides:
clone in class MessageDigestSpi