Top Fields Constructors Methods
org.bouncycastle.crypto.agreement.srp

public Class SRP6Util

extends Object
Class Inheritance
Imports
java.math.BigInteger, java.security.SecureRandom, org.bouncycastle.crypto.CryptoException, .Digest, org.bouncycastle.util.BigIntegers

Field Summary

Modifier and TypeField and Description
private static BigInteger
private static BigInteger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static BigInteger
public static BigInteger

Returns:

the final Key value.
calculateKey
(Digest
The Digest used as the hashing function H
digest
,
BigInteger
Modulus used to get the pad length
N
,
BigInteger
The secret calculated by both sides
S
)

Computes the final Key according to the standard routine: Key = H(S)

public static BigInteger

Returns:

M1 The calculated client evidence message
calculateM1
(Digest
The Digest used as the hashing function H
digest
,
BigInteger
Modulus used to get the pad length
N
,
BigInteger
The public client value
A
,
BigInteger
The public server value
B
,
BigInteger
The secret calculated by both sides
S
)

Computes the client evidence message (M1) according to the standard routine: M1 = H( A | B | S )

public static BigInteger

Returns:

M2 The calculated server evidence message
calculateM2
(Digest
The Digest used as the hashing function H
digest
,
BigInteger
Modulus used to get the pad length
N
,
BigInteger
The public client value
A
,
BigInteger
The client evidence message
M1
,
BigInteger
The secret calculated by both sides
S
)

Computes the server evidence message (M2) according to the standard routine: M2 = H( A | M1 | S )

public static BigInteger
public static BigInteger
calculateX(Digest digest, BigInteger N, byte[] salt, byte[] identity, byte[] password)

public static BigInteger
private static byte[]
getPadded(BigInteger n, int length)

private static BigInteger
private static BigInteger
public static BigInteger
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ONEback to summary
private static BigInteger ONE
ZEROback to summary
private static BigInteger ZERO

Constructor Detail

SRP6Utilback to summary
public SRP6Util()

Method Detail

calculateKback to summary
public static BigInteger calculateK(Digest digest, BigInteger N, BigInteger g)
calculateKeyback to summary
public static BigInteger calculateKey(Digest digest, BigInteger N, BigInteger S)

Computes the final Key according to the standard routine: Key = H(S)

Parameters
digest:Digest

The Digest used as the hashing function H

N:BigInteger

Modulus used to get the pad length

S:BigInteger

The secret calculated by both sides

Returns:BigInteger

the final Key value.

calculateM1back to summary
public 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 )

Parameters
digest:Digest

The Digest used as the hashing function H

N:BigInteger

Modulus used to get the pad length

A:BigInteger

The public client value

B:BigInteger

The public server value

S:BigInteger

The secret calculated by both sides

Returns:BigInteger

M1 The calculated client evidence message

calculateM2back to summary
public 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 )

Parameters
digest:Digest

The Digest used as the hashing function H

N:BigInteger

Modulus used to get the pad length

A:BigInteger

The public client value

M1:BigInteger

The client evidence message

S:BigInteger

The secret calculated by both sides

Returns:BigInteger

M2 The calculated server evidence message

calculateUback to summary
public static BigInteger calculateU(Digest digest, BigInteger N, BigInteger A, BigInteger B)
calculateXback to summary
public static BigInteger calculateX(Digest digest, BigInteger N, byte[] salt, byte[] identity, byte[] password)
generatePrivateValueback to summary
public static BigInteger generatePrivateValue(Digest digest, BigInteger N, BigInteger g, SecureRandom random)
getPaddedback to summary
private static byte[] getPadded(BigInteger n, int length)
hashPaddedPairback to summary
private static BigInteger hashPaddedPair(Digest digest, BigInteger N, BigInteger n1, BigInteger n2)
hashPaddedTripletback to summary
private static BigInteger hashPaddedTriplet(Digest digest, BigInteger N, BigInteger n1, BigInteger n2, BigInteger n3)
validatePublicValueback to summary
public static BigInteger validatePublicValue(BigInteger N, BigInteger val) throws CryptoException