Class MD4


  • public final class MD4
    extends java.lang.Object
    The MD4 class is used to compute an MD4 message digest over a given buffer of bytes. It is an implementation of the RSA Data Security Inc MD4 algorithim as described in internet RFC 1320.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static int blockSize  
      private byte[] buffer  
      private int bufOfs  
      private long bytesProcessed  
      private static byte[] padding  
      private static int S11  
      private static int S12  
      private static int S13  
      private static int S14  
      private static int S21  
      private static int S22  
      private static int S23  
      private static int S24  
      private static int S31  
      private static int S32  
      private static int S33  
      private static int S34  
      private int[] state  
      private int[] x  
    • Constructor Summary

      Constructors 
      Constructor Description
      MD4()
      Standard constructor, creates a new MD4 instance.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte[] digest​(byte[] in)
      Compute and return the message digest of the input byte array.
      private void engineUpdate​(byte[] b, int ofs, int len)  
      private static int FF​(int a, int b, int c, int d, int x, int s)  
      private static int GG​(int a, int b, int c, int d, int x, int s)  
      private static int HH​(int a, int b, int c, int d, int x, int s)  
      private void implCompress​(byte[] buf, int ofs)
      This is where the functions come together as the generic MD4 transformation operation.
      private void implDigest​(byte[] out, int ofs)
      Perform the final computations, any buffered bytes are added to the digest, the count is added to the digest, and the resulting digest is stored.
      private void implReset()
      Reset the state of this object.
      • Methods inherited from class java.lang.Object

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

      • MD4

        public MD4()
        Standard constructor, creates a new MD4 instance.
    • Method Detail

      • digest

        public byte[] digest​(byte[] in)
        Compute and return the message digest of the input byte array.
        Parameters:
        in - the input byte array
        Returns:
        the message digest byte array
      • implReset

        private void implReset()
        Reset the state of this object.
      • implDigest

        private void implDigest​(byte[] out,
                                int ofs)
        Perform the final computations, any buffered bytes are added to the digest, the count is added to the digest, and the resulting digest is stored.
      • engineUpdate

        private void engineUpdate​(byte[] b,
                                  int ofs,
                                  int len)
      • FF

        private static int FF​(int a,
                              int b,
                              int c,
                              int d,
                              int x,
                              int s)
      • GG

        private static int GG​(int a,
                              int b,
                              int c,
                              int d,
                              int x,
                              int s)
      • HH

        private static int HH​(int a,
                              int b,
                              int c,
                              int d,
                              int x,
                              int s)
      • implCompress

        private void implCompress​(byte[] buf,
                                  int ofs)
        This is where the functions come together as the generic MD4 transformation operation. It consumes 64 bytes from the buffer, beginning at the specified offset.