- java.lang.Object
-
- com.github.glusk.srp6_variables.AbstractSRP6IntegerVariable
-
- com.github.glusk.srp6_variables.SRP6Multiplier
-
- All Implemented Interfaces:
SRP6IntegerVariable
public final class SRP6Multiplier extends AbstractSRP6IntegerVariable
SRP-6 Multiplier Parameter (k).This variable is computed as:
k = 3
in SRP-6, and as:k = H(N | g)
in SRP-6a.Refer to the
package docsfor more info on notation used.
-
-
Constructor Summary
Constructors Constructor Description SRP6Multiplier()Constructs a new SRP-6 Multiplier Parameter.SRP6Multiplier(ImmutableMessageDigest hashFunction, SRP6IntegerVariable prime, SRP6IntegerVariable generator, ByteOrder byteOrder)Constructs a new SRP-6 Multiplier Parameter as specified in RFC 5054.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Bytesbytes(ByteOrder preferredOrder)ReturnsthisSRP-6 Integer Variable as a byte sequence in the preferred byte order.-
Methods inherited from class com.github.glusk.srp6_variables.AbstractSRP6IntegerVariable
equals, hashCode
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.github.glusk.srp6_variables.SRP6IntegerVariable
asNonNegativeBigInteger, bytes
-
-
-
-
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:gis zero-padded to the byte length ofN.- 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
ReturnsthisSRP-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 representsthisSRP-6 Integer Variable- Returns:
- the byte sequence that represents
thisSRP-6 Integer Variable in the preferred byte order - Throws:
IllegalStateException- if byte length ofNis shorter than the byte length ofg
-
-