Class SRP6Util


  • public class SRP6Util
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.math.BigInteger ONE  
      private static java.math.BigInteger ZERO  
    • Constructor Summary

      Constructors 
      Constructor Description
      SRP6Util()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.math.BigInteger calculateK​(Digest digest, java.math.BigInteger N, java.math.BigInteger g)  
      static java.math.BigInteger calculateU​(Digest digest, java.math.BigInteger N, java.math.BigInteger A, java.math.BigInteger B)  
      static java.math.BigInteger calculateX​(Digest digest, java.math.BigInteger N, byte[] salt, byte[] identity, byte[] password)  
      static java.math.BigInteger generatePrivateValue​(Digest digest, java.math.BigInteger N, java.math.BigInteger g, java.security.SecureRandom random)  
      private static byte[] getPadded​(java.math.BigInteger n, int length)  
      private static java.math.BigInteger hashPaddedPair​(Digest digest, java.math.BigInteger N, java.math.BigInteger n1, java.math.BigInteger n2)  
      static java.math.BigInteger validatePublicValue​(java.math.BigInteger N, java.math.BigInteger val)  
      • Methods inherited from class java.lang.Object

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

      • ZERO

        private static java.math.BigInteger ZERO
      • ONE

        private static java.math.BigInteger ONE
    • Constructor Detail

      • SRP6Util

        public SRP6Util()
    • Method Detail

      • calculateK

        public static java.math.BigInteger calculateK​(Digest digest,
                                                      java.math.BigInteger N,
                                                      java.math.BigInteger g)
      • calculateU

        public static java.math.BigInteger calculateU​(Digest digest,
                                                      java.math.BigInteger N,
                                                      java.math.BigInteger A,
                                                      java.math.BigInteger B)
      • calculateX

        public static java.math.BigInteger calculateX​(Digest digest,
                                                      java.math.BigInteger N,
                                                      byte[] salt,
                                                      byte[] identity,
                                                      byte[] password)
      • generatePrivateValue

        public static java.math.BigInteger generatePrivateValue​(Digest digest,
                                                                java.math.BigInteger N,
                                                                java.math.BigInteger g,
                                                                java.security.SecureRandom random)
      • validatePublicValue

        public static java.math.BigInteger validatePublicValue​(java.math.BigInteger N,
                                                               java.math.BigInteger val)
                                                        throws CryptoException
        Throws:
        CryptoException
      • hashPaddedPair

        private static java.math.BigInteger hashPaddedPair​(Digest digest,
                                                           java.math.BigInteger N,
                                                           java.math.BigInteger n1,
                                                           java.math.BigInteger n2)
      • getPadded

        private static byte[] getPadded​(java.math.BigInteger n,
                                        int length)