com.ibm.crypto.fips.provider
Class SHA224
- java.lang.Object
-
- java.security.MessageDigestSpi
-
- com.ibm.crypto.fips.provider.SHA224
-
- All Implemented Interfaces:
- java.lang.Cloneable
public final class SHA224 extends java.security.MessageDigestSpi implements java.lang.CloneableThis class implements the Secure Hash Algorithm 224 (SHA224) developed by the National Institute of Standards and Technology along with the National Security Agency. The algorithm is the same as SHA2, but with a different initial value and a truncation from 256 to 224 bits when producing the final value.
-
-
Constructor Summary
Constructors Constructor and Description SHA224()Standard constructor, creates a new SHA2 instance, allocates its buffers from the heap.
-
Method Summary
Methods Modifier and Type Method and Description java.lang.Objectclone()Clones this object.protected byte[]engineDigest()Compute the final hash and reset the engine so that it is ready for re-use, as specifed by MessageDigest.protected intengineDigest(byte[] buf, int offset, int len)Compute the final hash and reset the engine so that it is ready for re-use, as specifed by MessageDigest.protected intengineGetDigestLength()Return the digest length in bytesprotected voidengineReset()protected voidengineUpdate(byte b)Update adds the passed byte to the digested data.protected voidengineUpdate(byte[] input, int offset, int len)Update adds the selected part of an array of bytes to the digest.voidinit()Initialize the SHA2 informationjava.lang.ObjectinternalClone()Clones this object.protected byte[]internalDigest()Compute the final hash and reset the engine so that it is ready for re-use, as specifed by MessageDigest.protected intinternalDigest(byte[] buf, int offset, int len)Compute the final hash and reset the engine so that it is ready for re-use, as specifed by MessageDigest.protected intinternalGetDigestLength()Return the digest length in bytesvoidinternalInit()Initialize the SHA2 informationprotected voidinternalReset()protected voidinternalUpdate(byte b)Update adds the passed byte to the digested data.protected voidinternalUpdate(byte[] input, int offset, int len)Update adds the selected part of an array of bytes to the digest.
-
-
-
Constructor Detail
-
SHA224
public SHA224()
Standard constructor, creates a new SHA2 instance, allocates its buffers from the heap.
-
-
Method Detail
-
init
public void init()
Initialize the SHA2 information- Throws:
FIPSRuntimeException- if SelfTest.isFipsRunnable returns false.
-
internalInit
public void internalInit()
Initialize the SHA2 information
-
engineReset
protected void engineReset()
- Specified by:
engineResetin classjava.security.MessageDigestSpi- Throws:
FIPSRuntimeException- if SelfTest.isFipsRunnable returns false.
-
internalReset
protected void internalReset()
-
engineGetDigestLength
protected int engineGetDigestLength()
Return the digest length in bytes- Overrides:
engineGetDigestLengthin classjava.security.MessageDigestSpi- Throws:
FIPSRuntimeException- if SelfTest.isFipsRunnable returns false.
-
internalGetDigestLength
protected int internalGetDigestLength()
Return the digest length in bytes
-
engineUpdate
protected void engineUpdate(byte b)
Update adds the passed byte to the digested data.- Specified by:
engineUpdatein classjava.security.MessageDigestSpi- Throws:
FIPSRuntimeException- if SelfTest.isFipsRunnable returns false.
-
internalUpdate
protected void internalUpdate(byte b)
Update adds the passed byte to the digested data.
-
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:
engineUpdatein classjava.security.MessageDigestSpi- Throws:
FIPSRuntimeException- if SelfTest.isFipsRunnable returns false.
-
internalUpdate
protected void internalUpdate(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.
-
engineDigest
protected byte[] engineDigest()
Compute the final hash and reset the engine so that it is ready for re-use, as specifed by MessageDigest.- Specified by:
engineDigestin classjava.security.MessageDigestSpi- Throws:
FIPSRuntimeException- if SelfTest.isFipsRunnable returns false.
-
internalDigest
protected byte[] internalDigest()
Compute the final hash and reset the engine so that it is ready for re-use, as specifed by MessageDigest.
-
engineDigest
protected int engineDigest(byte[] buf, int offset, int len) throws java.security.DigestExceptionCompute the final hash and reset the engine so that it is ready for re-use, as specifed by MessageDigest.- Overrides:
engineDigestin classjava.security.MessageDigestSpi- Throws:
FIPSRuntimeException- if SelfTest.isFipsRunnable returns false.java.security.DigestException
-
internalDigest
protected int internalDigest(byte[] buf, int offset, int len) throws java.security.DigestExceptionCompute the final hash and reset the engine so that it is ready for re-use, as specifed by MessageDigest.- Throws:
java.security.DigestException
-
clone
public java.lang.Object clone()
Clones this object.- Overrides:
clonein classjava.security.MessageDigestSpi- Throws:
FIPSRuntimeException- if SelfTest.isFipsRunnable returns false.
-
internalClone
public java.lang.Object internalClone()
Clones this object.
-
-