common
Class GenPrime

java.lang.Object
  extended by common.GenPrime

public class GenPrime
extends java.lang.Object

Generates prime p and prime q for the encryption scheme. The primes are generated based on the provided security parameters in Parameters.

Author:
vohuudtr

Constructor Summary
GenPrime()
           
 
Method Summary
static int calculateSizeP(int size_q)
          Calculates the required size in bits of prime p.
static int calculateSizeQ()
          Calculates the required size in bits of prime q.
static void generatePrime()
          Generates prime p and q.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenPrime

public GenPrime()
Method Detail

calculateSizeQ

public static int calculateSizeQ()
Calculates the required size in bits of prime q.

Returns:
number of bits of prime q.

calculateSizeP

public static int calculateSizeP(int size_q)
Calculates the required size in bits of prime p. This calculation requires the calculation of q to be done first.

Parameters:
size_q - size of q.
Returns:
number of bits of prime p.

generatePrime

public static void generatePrime()
Generates prime p and q.