Package com.github.glusk.srp6_variables
Class SRP6ScramblingParameter
- java.lang.Object
-
- com.github.glusk.srp6_variables.AbstractSRP6IntegerVariable
-
- com.github.glusk.srp6_variables.SRP6ScramblingParameter
-
- All Implemented Interfaces:
SRP6IntegerVariable
public final class SRP6ScramblingParameter extends AbstractSRP6IntegerVariable
SRP-6 Random Scrambling Parameter (u).This variable is computed as:
u = H(A | B)
whereH()is a one-way hash function,|a concatenation operator,Aclient's public key andBthe server's public key.
-
-
Constructor Summary
Constructors Constructor Description SRP6ScramblingParameter(ImmutableMessageDigest hashFunction, SRP6IntegerVariable clientPublicKey, SRP6IntegerVariable serverPublicKey, SRP6IntegerVariable prime, ByteOrder byteOrder)Constructs a new SRP-6 Random Scrambling 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
-
SRP6ScramblingParameter
public SRP6ScramblingParameter(ImmutableMessageDigest hashFunction, SRP6IntegerVariable clientPublicKey, SRP6IntegerVariable serverPublicKey, SRP6IntegerVariable prime, ByteOrder byteOrder)
Constructs a new SRP-6 Random Scrambling Parameter as specified in RFC 5054.u = H(PAD(A) | PAD(B))
Note:AandBare zero-padded to the byte length ofN.- Parameters:
hashFunction- a one-way hash function - H()clientPublicKey- SRP-6 variable: client public key (A)serverPublicKey- SRP-6 variable: server public key (B)prime- SRP-6 variable: prime (N)byteOrder- the byte order to use when converting the resulting hash to integer and the byte order of public keys' 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 of eitherAorB
-
-