part3
Class Utilities

java.lang.Object
  extended bypart3.Utilities

public class Utilities
extends java.lang.Object


Method Summary
static java.math.BigInteger findg(java.math.BigInteger p, java.util.AbstractList factors)
          A method to find a generator for the group Zp* where p is a prime and factors are the prime factors of p-1.
static boolean isGenerator(java.math.BigInteger p, java.util.AbstractList factors, java.math.BigInteger a)
          A method to determine if a is a generator for the group Zp* where p is a prime and factors are the prime factors of p-1.
static java.math.BigInteger log(java.math.BigInteger p, java.math.BigInteger a, java.math.BigInteger b)
          A method to return the discrete logarithm of b to the base a (logab) in Zp* where p is a prime and a is a generator of Zp*.
static java.math.BigInteger order(java.math.BigInteger p, java.util.AbstractList factors, java.math.BigInteger a)
          A method to determine the order of a in the group Zp* where p is a prime and factors are the prime factors of p-1.
static java.util.AbstractList pair(java.security.SecureRandom rnd, int d)
          A method to return a safe prime p and a generator a for Zp* where d is the number of bits in p and rnd is a source of randomness.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

order

public static java.math.BigInteger order(java.math.BigInteger p,
                                         java.util.AbstractList factors,
                                         java.math.BigInteger a)
                                  throws java.lang.Exception
A method to determine the order of a in the group Zp* where p is a prime and factors are the prime factors of p-1.

Throws:
java.lang.Exception

isGenerator

public static boolean isGenerator(java.math.BigInteger p,
                                  java.util.AbstractList factors,
                                  java.math.BigInteger a)
                           throws java.lang.Exception
A method to determine if a is a generator for the group Zp* where p is a prime and factors are the prime factors of p-1.

Throws:
java.lang.Exception

findg

public static java.math.BigInteger findg(java.math.BigInteger p,
                                         java.util.AbstractList factors)
                                  throws java.lang.Exception
A method to find a generator for the group Zp* where p is a prime and factors are the prime factors of p-1.

Throws:
java.lang.Exception

pair

public static java.util.AbstractList pair(java.security.SecureRandom rnd,
                                          int d)
                                   throws java.lang.Exception
A method to return a safe prime p and a generator a for Zp* where d is the number of bits in p and rnd is a source of randomness. Note that pair() returns a list with two components; the first component is p and the second component is a.

Throws:
java.lang.Exception

log

public static java.math.BigInteger log(java.math.BigInteger p,
                                       java.math.BigInteger a,
                                       java.math.BigInteger b)
                                throws java.lang.Exception
A method to return the discrete logarithm of b to the base a (logab) in Zp* where p is a prime and a is a generator of Zp*.

Throws:
java.lang.Exception