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.MessageDigestSpi
    Implementation 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 int engineDigest(byte[] buf, int offset, int len)
      Completes the digest by padding and running the final compression.
      protected int engineGetDigestLength()
      Return the digest length in bytes
      protected void engineReset()
      Returns the message digest object to its original state.
      protected void engineUpdate(byte input)
      Adds a byte of data to be processed by the message digest algorithm.
      protected void engineUpdate(byte[] input, int offset, int len)
      Adds len bytes of data from input to be processed by the message digest algorithm.
      void setupH(byte[] h) 
      • Methods inherited from class java.security.MessageDigestSpi

        clone, engineUpdate
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GhashMD

        public GhashMD()
        Standard constructor.
    • Method Detail

      • engineGetDigestLength

        protected int engineGetDigestLength()
        Return the digest length in bytes
        Overrides:
        engineGetDigestLength in class java.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:
        engineDigest in class java.security.MessageDigestSpi
        Returns:
        byte[] - the resulting message digest
      • engineDigest

        protected int engineDigest(byte[] buf,
                       int offset,
                       int len)
                            throws java.security.DigestException
        Completes 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:
        engineDigest in class java.security.MessageDigestSpi
        Parameters:
        buf - - byte array for storing the message digest
        offset - - beginning index of the digest in buf
        len - - 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:
        engineReset in class java.security.MessageDigestSpi
      • engineUpdate

        protected void engineUpdate(byte input)
        Adds a byte of data to be processed by the message digest algorithm.
        Specified by:
        engineUpdate in class java.security.MessageDigestSpi
        Parameters:
        input - - data to be processed
      • engineUpdate

        protected void engineUpdate(byte[] input,
                        int offset,
                        int len)
        Adds len bytes of data from input to be processed by the message digest algorithm.
        Specified by:
        engineUpdate in class java.security.MessageDigestSpi
        Parameters:
        input - - array that data bytes are taken from
        offset - - index of input to start taking data from
        len - - number of bytes to be processed
      • setupH

        public void setupH(byte[] h)
© Portions Copyright 2003, 2014, 2015, 2016 IBM Corporation. All rights reserved.
© Portions Copyright 2003, 2014 Oracle and/or its affiliates. All rights reserved.