Top Inners Fields Constructors Methods
org.bouncycastle.crypto.generators

public Class CramerShoupParametersGenerator

extends Object
Class Inheritance
Imports
java.math.BigInteger, java.security.SecureRandom, org.bouncycastle.crypto.digests.SHA256Digest, org.bouncycastle.crypto.params.CramerShoupParameters, .DHParameters, org.bouncycastle.util.BigIntegers

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private int
private static final BigInteger
private SecureRandom
private int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public CramerShoupParameters

Returns:

a generated CramerShoupParameters object.
generateParameters
()

which generates the p and g values from the given parameters, returning the CramerShoupParameters object.

public CramerShoupParameters
public void
init(int
bit length for the prime p
size
,
int
a measure of the uncertainty that the caller is willing to tolerate: the probability that the generated modulus is prime exceeds (1 - 1/2^certainty). The execution time of this method is proportional to the value of this parameter.
certainty
,
SecureRandom
a source of randomness
random
)

Initialise the parameters generator.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

certaintyback to summary
private int certainty
ONEback to summary
private static final BigInteger ONE
randomback to summary
private SecureRandom random
sizeback to summary
private int size

Constructor Detail

CramerShoupParametersGeneratorback to summary
public CramerShoupParametersGenerator()

Method Detail

generateParametersback to summary
public CramerShoupParameters generateParameters()

which generates the p and g values from the given parameters, returning the CramerShoupParameters object.

Note

can take a while...

Returns:CramerShoupParameters

a generated CramerShoupParameters object.

generateParametersback to summary
public CramerShoupParameters generateParameters(DHParameters dhParams)
initback to summary
public void init(int size, int certainty, SecureRandom random)

Initialise the parameters generator.

Parameters
size:int

bit length for the prime p

certainty:int

a measure of the uncertainty that the caller is willing to tolerate: the probability that the generated modulus is prime exceeds (1 - 1/2^certainty). The execution time of this method is proportional to the value of this parameter.

random:SecureRandom

a source of randomness

org.bouncycastle.crypto.generators back to summary

private Class CramerShoupParametersGenerator.ParametersHelper

extends Object
Class Inheritance
  • java.lang.Object
  • org.bouncycastle.crypto.generators.CramerShoupParametersGenerator.ParametersHelper

Field Summary

Modifier and TypeField and Description
private static final BigInteger

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv static BigInteger[]
generateSafePrimes(int size, int certainty, SecureRandom random)

pack-priv static BigInteger
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

TWOback to summary
private static final BigInteger TWO

Constructor Detail

ParametersHelperback to summary
private ParametersHelper()

Method Detail

generateSafePrimesback to summary
pack-priv static BigInteger[] generateSafePrimes(int size, int certainty, SecureRandom random)
selectGeneratorback to summary
pack-priv static BigInteger selectGenerator(BigInteger p, SecureRandom random)