Top Fields Constructors Methods
org.bouncycastle.tls.crypto.impl.jcajce.srp

pack-priv Class SRP6Util

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

Field Summary

Modifier and TypeField and Description
private static final byte[]
private static BigInteger
private static BigInteger

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public static BigInteger
public static BigInteger

Returns:

the final Key value.
calculateKey
(TlsHash
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
(TlsHash
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
(TlsHash
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(TlsHash 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

COLONback to summary
private static final byte[] COLON
ONEback to summary
private static BigInteger ONE
ZEROback to summary
private static BigInteger ZERO

Constructor Detail

SRP6Utilback to summary
pack-priv SRP6Util()

Method Detail

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

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

Parameters
digest:TlsHash

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(TlsHash 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:TlsHash

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(TlsHash 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:TlsHash

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(TlsHash digest, BigInteger N, BigInteger A, BigInteger B)
calculateXback to summary
public static BigInteger calculateX(TlsHash digest, BigInteger N, byte[] salt, byte[] identity, byte[] password)
generatePrivateValueback to summary
public static BigInteger generatePrivateValue(BigInteger N, BigInteger g, SecureRandom random)
getPaddedback to summary
private static byte[] getPadded(BigInteger n, int length)
hashPaddedPairback to summary
private static BigInteger hashPaddedPair(TlsHash digest, BigInteger N, BigInteger n1, BigInteger n2)
hashPaddedTripletback to summary
private static BigInteger hashPaddedTriplet(TlsHash digest, BigInteger N, BigInteger n1, BigInteger n2, BigInteger n3)
validatePublicValueback to summary
public static BigInteger validatePublicValue(BigInteger N, BigInteger val) throws IllegalArgumentException