public class SRP6Util extends Object
Constructor and Description |
---|
SRP6Util() |
Modifier and Type | Method and Description |
---|---|
static BigInteger |
calculateK(Digest digest,
BigInteger N,
BigInteger g) |
static BigInteger |
calculateKey(Digest digest,
BigInteger N,
BigInteger S)
Computes the final Key according to the standard routine: Key = H(S)
|
static BigInteger |
calculateM1(Digest digest,
BigInteger N,
BigInteger A,
BigInteger B,
BigInteger S)
Computes the client evidence message (M1) according to the standard routine:
M1 = H( A | B | S )
|
static BigInteger |
calculateM2(Digest digest,
BigInteger N,
BigInteger A,
BigInteger M1,
BigInteger S)
Computes the server evidence message (M2) according to the standard routine:
M2 = H( A | M1 | S )
|
static BigInteger |
calculateU(Digest digest,
BigInteger N,
BigInteger A,
BigInteger B) |
static BigInteger |
calculateX(Digest digest,
BigInteger N,
byte[] salt,
byte[] identity,
byte[] password) |
static BigInteger |
generatePrivateValue(Digest digest,
BigInteger N,
BigInteger g,
SecureRandom random) |
static BigInteger |
validatePublicValue(BigInteger N,
BigInteger val) |
public static BigInteger calculateK(Digest digest, BigInteger N, BigInteger g)
public static BigInteger calculateU(Digest digest, BigInteger N, BigInteger A, BigInteger B)
public static BigInteger calculateX(Digest digest, BigInteger N, byte[] salt, byte[] identity, byte[] password)
public static BigInteger generatePrivateValue(Digest digest, BigInteger N, BigInteger g, SecureRandom random)
public static BigInteger validatePublicValue(BigInteger N, BigInteger val) throws CryptoException
CryptoException
public static BigInteger calculateM1(Digest digest, BigInteger N, BigInteger A, BigInteger B, BigInteger S)
digest
- The Digest used as the hashing function HN
- Modulus used to get the pad lengthA
- The public client valueB
- The public server valueS
- The secret calculated by both sidespublic static BigInteger calculateM2(Digest digest, BigInteger N, BigInteger A, BigInteger M1, BigInteger S)
digest
- The Digest used as the hashing function HN
- Modulus used to get the pad lengthA
- The public client valueM1
- The client evidence messageS
- The secret calculated by both sidespublic static BigInteger calculateKey(Digest digest, BigInteger N, BigInteger S)
digest
- The Digest used as the hashing function HN
- Modulus used to get the pad lengthS
- The secret calculated by both sidesCopyright © 2016 BouncyCastle.org. All rights reserved.