Class SRP6Multiplier

    • Constructor Detail

      • SRP6Multiplier

        public SRP6Multiplier()
        Constructs a new SRP-6 Multiplier Parameter.
         k = 3
         
      • SRP6Multiplier

        public SRP6Multiplier​(ImmutableMessageDigest hashFunction,
                              SRP6IntegerVariable prime,
                              SRP6IntegerVariable generator,
                              ByteOrder byteOrder)
        Constructs a new SRP-6 Multiplier Parameter as specified in RFC 5054.
         k = H(N | PAD(g))
         
        Note: g is zero-padded to the byte length of N.
        Parameters:
        hashFunction - a one-way hash function - H()
        prime - SRP-6 variable: prime (N)
        generator - SRP-6 variable: generator (g)
        byteOrder - the byte order to use when converting the resulting hash to integer and the byte order of prime and generator byte sequences to feed to the hash function
    • Method Detail

      • bytes

        public Bytes bytes​(ByteOrder preferredOrder)
                    throws IllegalStateException
        Returns this SRP-6 Integer Variable as a byte sequence in the preferred byte order.

        The representation returned must be minimal. That is, all leading (or trailing, depending on the preferredOrder) zero bytes have to be trimmed.

        Number zero is hence defined as an empty byte sequence.

        Parameters:
        preferredOrder - the preferred byte order of the byte sequence that represents this SRP-6 Integer Variable
        Returns:
        the byte sequence that represents this SRP-6 Integer Variable in the preferred byte order
        Throws:
        IllegalStateException - if byte length of N is shorter than the byte length of g