Class MacBasedPRF

  • All Implemented Interfaces:
    PRF

    public class MacBasedPRF
    extends java.lang.Object
    implements PRF
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int hLen  
      private javax.crypto.Mac mac  
      private java.lang.String macAlgorithm  
      private java.io.ByteArrayOutputStream macCache  
    • Constructor Summary

      Constructors 
      Constructor Description
      MacBasedPRF​(java.lang.String macAlgorithm)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte[] doFinal()  
      byte[] doFinal​(byte[] M)  
      byte[] doFinal​(int numberOfBytesToPushbackForMac)  
      private void doMacUpdate​(int numberOfBytesToPushBack)  
      int getHLen()  
      void init​(byte[] P)  
      void update​(byte[] u)  
      void update​(byte[] u, int start, int len)  
      • Methods inherited from class java.lang.Object

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

      • mac

        private javax.crypto.Mac mac
      • hLen

        private int hLen
      • macAlgorithm

        private java.lang.String macAlgorithm
      • macCache

        private java.io.ByteArrayOutputStream macCache
    • Constructor Detail

      • MacBasedPRF

        public MacBasedPRF​(java.lang.String macAlgorithm)
    • Method Detail

      • doFinal

        public byte[] doFinal​(byte[] M)
        Specified by:
        doFinal in interface PRF
      • doFinal

        public byte[] doFinal()
      • doFinal

        public byte[] doFinal​(int numberOfBytesToPushbackForMac)
      • getHLen

        public int getHLen()
        Specified by:
        getHLen in interface PRF
      • init

        public void init​(byte[] P)
        Specified by:
        init in interface PRF
      • update

        public void update​(byte[] u)
      • update

        public void update​(byte[] u,
                           int start,
                           int len)
      • doMacUpdate

        private void doMacUpdate​(int numberOfBytesToPushBack)