com.ibm.crypto.fips.provider
Class GhashMD
- java.lang.Object
-
- java.security.MessageDigestSpi
-
- com.ibm.crypto.fips.provider.GhashMD
-
public final class GhashMD extends java.security.MessageDigestSpiImplementation of the GHASH function from NIST SP 800-38D. http://csrc.nist.gov/publications/nistpubs/800-38D/SP-800-38D.pdf
-
-
Constructor Summary
Constructors Constructor and Description GhashMD()Standard constructor.
-
Method Summary
Methods Modifier and Type Method and Description protected byte[]engineDigest()Completes the digest by padding and running the final compression.protected intengineDigest(byte[] buf, int offset, int len)Completes the digest by padding and running the final compression.protected intengineGetDigestLength()Return the digest length in bytesprotected voidengineReset()Returns the message digest object to its original state.protected voidengineUpdate(byte input)Adds a byte of data to be processed by the message digest algorithm.protected voidengineUpdate(byte[] input, int offset, int len)Addslenbytes of data frominputto be processed by the message digest algorithm.voidsetupH(byte[] h)
-
-
-
Method Detail
-
engineGetDigestLength
protected int engineGetDigestLength()
Return the digest length in bytes- Overrides:
engineGetDigestLengthin classjava.security.MessageDigestSpi- Returns:
- the digest length in bytes
-
engineDigest
protected byte[] engineDigest()
Completes the digest by padding and running the final compression. Resulting digest is returned.- Specified by:
engineDigestin classjava.security.MessageDigestSpi- Returns:
- byte[] - the resulting message digest
-
engineDigest
protected int engineDigest(byte[] buf, int offset, int len) throws java.security.DigestExceptionCompletes the digest by padding and running the final compression. The resultant message digest is then placed in the byte array buf starting at position offset.- Overrides:
engineDigestin classjava.security.MessageDigestSpi- Parameters:
buf- - byte array for storing the message digestoffset- - beginning index of the digest in buflen- - max number of bytes of digest accepted, must be greater than digest size- Returns:
- int - length of message digest written into buf
- Throws:
java.security.DigestException- - if there is not enough room in buf for the full message digest
-
engineReset
protected void engineReset()
Returns the message digest object to its original state.- Specified by:
engineResetin classjava.security.MessageDigestSpi
-
engineUpdate
protected void engineUpdate(byte input)
Adds a byte of data to be processed by the message digest algorithm.- Specified by:
engineUpdatein classjava.security.MessageDigestSpi- Parameters:
input- - data to be processed
-
engineUpdate
protected void engineUpdate(byte[] input, int offset, int len)Addslenbytes of data frominputto be processed by the message digest algorithm.- Specified by:
engineUpdatein classjava.security.MessageDigestSpi- Parameters:
input- - array that data bytes are taken fromoffset- - index of input to start taking data fromlen- - number of bytes to be processed
-
setupH
public void setupH(byte[] h)
-
-