part5
Class Utilities

java.lang.Object
  extended bypart5.Utilities

public class Utilities
extends java.lang.Object


Nested Class Summary
static class Utilities.qResult
          A class to hold the results from the q method.
 
Method Summary
static java.math.BigInteger jacobi(java.math.BigInteger n, java.math.BigInteger a)
          A method to evaluate the Jacobi Symbol a/n.
static java.math.BigInteger jl(java.math.BigInteger n, java.math.BigInteger a)
          A method to evaluate the Legendre/Jacobi Symbols a/n using Algorithm 2.149 of The Handbook of Applied Cryptography.
static java.math.BigInteger legendre(java.math.BigInteger p, java.math.BigInteger a)
          A method to evaluate the Legendre Symbol a/p where p is an odd prime.
static java.util.AbstractList make1(int m, java.math.BigInteger n, java.math.BigInteger seed)
          A method to generate a random big integer value with m bits using a BBS Pseudo-Random Bit Generator.
static java.math.BigInteger make2(int m, java.math.BigInteger p, java.math.BigInteger q, java.math.BigInteger x)
          A method to recreate a random big integer with m bits produced by make1() given the primes p and q and the last value x (i.e., xm-1) of the internal sequence generated by the BBS Pseudo-Random Bit Generator.
static Utilities.qResult q(java.math.BigInteger n)
          A method to compute quadratic residues and nonresidues for n.
static boolean qTest(java.math.BigInteger n, java.math.BigInteger x, java.util.AbstractSet q)
          A method to determine if x in a quaratic residue (or nonresidue) modulo n where q is the set of quaratic residues (or nonresidues) restricted to Zn*.
static java.math.BigInteger rt(java.math.BigInteger p, java.math.BigInteger q, java.math.BigInteger x)
          A method to compute rtn(x) where n=p*q.
static java.math.BigInteger sq(java.math.BigInteger n, java.math.BigInteger x)
          A method to compute sqn(x).
static java.util.AbstractSet sRoot(java.math.BigInteger n, java.math.BigInteger x)
          A method to return the square roots of x modulo n.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

q

public static Utilities.qResult q(java.math.BigInteger n)
                           throws java.lang.Exception
A method to compute quadratic residues and nonresidues for n.

Throws:
java.lang.Exception

qTest

public static boolean qTest(java.math.BigInteger n,
                            java.math.BigInteger x,
                            java.util.AbstractSet q)
                     throws java.lang.Exception
A method to determine if x in a quaratic residue (or nonresidue) modulo n where q is the set of quaratic residues (or nonresidues) restricted to Zn*.

Throws:
java.lang.Exception

sRoot

public static java.util.AbstractSet sRoot(java.math.BigInteger n,
                                          java.math.BigInteger x)
                                   throws java.lang.Exception
A method to return the square roots of x modulo n.

Throws:
java.lang.Exception

legendre

public static java.math.BigInteger legendre(java.math.BigInteger p,
                                            java.math.BigInteger a)
                                     throws java.lang.Exception
A method to evaluate the Legendre Symbol a/p where p is an odd prime.

Throws:
java.lang.Exception

jacobi

public static java.math.BigInteger jacobi(java.math.BigInteger n,
                                          java.math.BigInteger a)
                                   throws java.lang.Exception
A method to evaluate the Jacobi Symbol a/n.

Throws:
java.lang.Exception

jl

public static java.math.BigInteger jl(java.math.BigInteger n,
                                      java.math.BigInteger a)
                               throws java.lang.Exception
A method to evaluate the Legendre/Jacobi Symbols a/n using Algorithm 2.149 of The Handbook of Applied Cryptography.

Throws:
java.lang.Exception

sq

public static java.math.BigInteger sq(java.math.BigInteger n,
                                      java.math.BigInteger x)
                               throws java.lang.Exception
A method to compute sqn(x).

Throws:
java.lang.Exception

rt

public static java.math.BigInteger rt(java.math.BigInteger p,
                                      java.math.BigInteger q,
                                      java.math.BigInteger x)
                               throws java.lang.Exception
A method to compute rtn(x) where n=p*q.

Throws:
java.lang.Exception

make1

public static java.util.AbstractList make1(int m,
                                           java.math.BigInteger n,
                                           java.math.BigInteger seed)
                                    throws java.lang.Exception
A method to generate a random big integer value with m bits using a BBS Pseudo-Random Bit Generator. The result is a list consisting of the random number and the last value (xm-1) of the internal sequence generated by the BBS Pseudo-Random Bit Generator.

Parameters:
n - the product of the two prime p and q used in make2().
Throws:
java.lang.Exception

make2

public static java.math.BigInteger make2(int m,
                                         java.math.BigInteger p,
                                         java.math.BigInteger q,
                                         java.math.BigInteger x)
                                  throws java.lang.Exception
A method to recreate a random big integer with m bits produced by make1() given the primes p and q and the last value x (i.e., xm-1) of the internal sequence generated by the BBS Pseudo-Random Bit Generator.

Throws:
java.lang.Exception