com.ibm.crypto.fips.provider

Class SHA

  1. java.lang.Object
  2. extended byjava.security.MessageDigestSpi
  3. extended bycom.ibm.crypto.fips.provider.SHA
All implemented interfaces:
AlgorithmStatus, java.lang.Cloneable

  1. public final class SHA
  2. extends java.security.MessageDigestSpi
  3. implements java.lang.Cloneable, AlgorithmStatus
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.
Version:
1.0, 07/13/99
Author:
Janelle Zhang

Constructor Summary

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

Method Summary

Modifier and Type Method and Description
  1. java.lang.Object
clone()
Clones this object.
  1. protected
  2. byte[]
engineDigest()
  1. protected
  2. int
engineDigest(byte[] buf,int offset,int len)
  1. protected
  2. int
engineGetDigestLength()
Return the digest length in bytes
  1. protected
  2. void
engineReset()
  1. protected
  2. void
engineUpdate(byte b)
Update adds the passed byte to the digested data.
  1. protected
  2. void
engineUpdate(byte[] input,int offset,int len)
Update adds the selected part of an array of bytes to the digest.
  1. void
init()
Initialize the SHA information
  1. protected
  2. java.lang.Object
internalClone()
Clones this object.
  1. protected
  2. byte[]
internalDigest()
  1. protected
  2. byte[]
internalDigest(byte[] buf)
  1. protected
  2. int
internalDigest(byte[] buf,int offset,int len)
  1. protected
  2. int
internalGetDigestLength()
Return the digest length in bytes
  1. protected
  2. void
internalInit()
Initialize the SHA information
  1. protected
  2. void
internalReset()
  1. protected
  2. void
internalUpdate(byte b)
Update adds the passed byte to the digested data.
  1. protected
  2. void
internalUpdate(byte[] input,int offset,int len)
Update adds the selected part of an array of bytes to the digest.
  1. boolean
isFipsApproved()
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

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

Method Detail

isFipsApproved

  1. public boolean isFipsApproved()
Description copied from interface: AlgorithmStatus
Module identifies if the cryptographic operation (algorithm) is FIPS certified
Specified by:
See Also:

init

  1. public void init()
Initialize the SHA information
Throws:
FIPSRuntimeException - if SelfTest.isFipsRunnable returns false.

internalInit

  1. protected void internalInit()
Initialize the SHA information

engineReset

  1. protected void engineReset()
Specified by:
engineReset in class java.security.MessageDigestSpi
Throws:
FIPSRuntimeException - if SelfTest.isFipsRunnable returns false.

internalReset

  1. protected void internalReset()

engineGetDigestLength

  1. protected int engineGetDigestLength( )
Return the digest length in bytes
Overrides:
engineGetDigestLength in class java.security.MessageDigestSpi
Throws:
FIPSRuntimeException - if SelfTest.isFipsRunnable returns false.

internalGetDigestLength

  1. protected int internalGetDigestLength( )
Return the digest length in bytes

engineUpdate

  1. protected void engineUpdate(byte b)
Update adds the passed byte to the digested data.
Specified by:
engineUpdate in class java.security.MessageDigestSpi
Throws:
FIPSRuntimeException - if SelfTest.isFipsRunnable returns false.

internalUpdate

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

engineUpdate

  1. protected void engineUpdate(byte[] input,
  2. int offset,
  3. 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 java.security.MessageDigestSpi
Throws:
FIPSRuntimeException - if SelfTest.isFipsRunnable returns false.

internalUpdate

  1. protected void internalUpdate(byte[] input,
  2. int offset,
  3. 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.

engineDigest

  1. protected byte[] engineDigest()
Specified by:
engineDigest in class java.security.MessageDigestSpi
Throws:
FIPSRuntimeException - if SelfTest.isFipsRunnable returns false.

internalDigest

  1. protected byte[] internalDigest( )

engineDigest

  1. protected int engineDigest(byte[] buf,
  2. int offset,
  3. int len)
  4. throws java.security.DigestException
Overrides:
engineDigest in class java.security.MessageDigestSpi
Throws:
FIPSRuntimeException - if SelfTest.isFipsRunnable returns false.
java.security.DigestException

internalDigest

  1. protected int internalDigest(byte[] buf,
  2. int offset,
  3. int len)
  4. throws java.security.DigestException
Throws:
java.security.DigestException

internalDigest

  1. protected byte[] internalDigest( byte[] buf)
  2. throws java.security.DigestException
Throws:
java.security.DigestException

clone

  1. public java.lang.Object clone()
Clones this object.
Overrides:
clone in class java.security.MessageDigestSpi
Throws:
FIPSRuntimeException - if SelfTest.isFipsRunnable returns false.

internalClone

  1. protected java.lang.Object internalClone( )
Clones this object.