common
Class Parameters

java.lang.Object
  extended by common.Parameters

public class Parameters
extends java.lang.Object

Provides tools for handling the parameters used for the encryption scheme.

The following parameters are controlled:

Secret key
p
secret prime p in the encryption scheme.
b
secret random b in the encryption scheme.
Public parameters
q
prime q in the encryption scheme.
s1
security parameter s1 in the encryption scheme.
s2
maximum size in bits of the random r in the encryption scheme.
n
upperbound of the number of records in the data set.
numFields
number of countable fields in each record.
Note: numFields is the actual number of countable fields in a record, while Record.getNumFields() returns the number of fields contained in a record, which includes both encrypted and plain-text fields, so Record.getNumFields() is equal to 2*numFields (see Record).
sizeD[]
Domain size in bits of the countable fields.

Author:
vohuudtr

Constructor Summary
Parameters()
           
 
Method Summary
static java.math.BigInteger getB()
          Returns secret b.
static int getMaxSizeD()
          Returns the maximum domain size over all the countable fields.
static java.math.BigInteger getN()
          Returns upperbound of the number of records.
static int getNumFields()
          Returns number of countable fields.
static java.math.BigInteger getP()
          Returns secret prime p.
static java.math.BigInteger getQ()
          Returns prime q.
static int getS1()
          Returns security parameter s1.
static int getS2()
          Returns security parameter s2.
static int getSizeD(int field)
          Returns domain size of a field.
static int getTotalSizeD()
          Returns the total domain size which is the product of domain size of all fields.
static void main(java.lang.String[] args)
           
static void readConfig(java.io.InputStream is)
          Reads parameters from an input stream.
static void readConfig(java.lang.String filename)
          Reads parameters from a configuration file.
static void setB(java.math.BigInteger newb)
          Sets the new value for b.
static void setP(java.math.BigInteger newp)
          Sets new secret prime p.
static void setQ(java.math.BigInteger newq)
          Sets new prime q.
static void writeConfig(java.io.OutputStream os)
          Writes parameters to an output stream.
static void writeConfig(java.lang.String filename)
          Writes parameters to a configuration file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Parameters

public Parameters()
Method Detail

getP

public static java.math.BigInteger getP()
Returns secret prime p.

Returns:
secret prime p.

setP

public static void setP(java.math.BigInteger newp)
Sets new secret prime p.

Parameters:
newp - new secret prime p.

getB

public static java.math.BigInteger getB()
Returns secret b.

Returns:
secret b.

setB

public static void setB(java.math.BigInteger newb)
Sets the new value for b.

Parameters:
newb - new value for b.

getQ

public static java.math.BigInteger getQ()
Returns prime q.

Returns:
prime q.

setQ

public static void setQ(java.math.BigInteger newq)
Sets new prime q.

Parameters:
newq - new prime q.

getN

public static java.math.BigInteger getN()
Returns upperbound of the number of records.

Returns:
upperbound of the number of records.

getS1

public static int getS1()
Returns security parameter s1.

Returns:
security parameter s1.

getS2

public static int getS2()
Returns security parameter s2.

Returns:
security parameter s2.

getSizeD

public static int getSizeD(int field)
Returns domain size of a field.

Parameters:
field - given field.
Returns:
domain size of the specified field.

getMaxSizeD

public static int getMaxSizeD()
Returns the maximum domain size over all the countable fields.

Returns:
maximum domain size.

getNumFields

public static int getNumFields()
Returns number of countable fields.

Returns:
number of countable fields.

getTotalSizeD

public static int getTotalSizeD()
Returns the total domain size which is the product of domain size of all fields.

Returns:
total domain size.

writeConfig

public static void writeConfig(java.lang.String filename)
Writes parameters to a configuration file.

Parameters:
filename - name of the configuration file.

writeConfig

public static void writeConfig(java.io.OutputStream os)
Writes parameters to an output stream.

Parameters:
os - output stream.

readConfig

public static void readConfig(java.lang.String filename)
Reads parameters from a configuration file.

Parameters:
filename - name of the configuration file.

readConfig

public static void readConfig(java.io.InputStream is)
Reads parameters from an input stream.

Parameters:
is - input stream.

main

public static void main(java.lang.String[] args)
Parameters:
args -