paillierp.key
Class PaillierPrivateThresholdKey

java.lang.Object
  extended by paillierp.key.PaillierKey
      extended by paillierp.key.PaillierThresholdKey
          extended by paillierp.key.PaillierPrivateThresholdKey
All Implemented Interfaces:
java.io.Serializable

public class PaillierPrivateThresholdKey
extends PaillierThresholdKey

A private key for the threshold Paillier scheme CS1. This key is used to partially decrypt a ciphertext. At least PaillierThresholdKey.w cooperating decryption servers are needed in this scheme to produce a full decryption. The public information provided for in

The private key in this threshold scheme requires the following information to produce a partial decryption:

Version:
0.9 03/25/10
Author:
James Garrity, Sean Hall
See Also:
PaillierKey, KeyGen, Serialized Form

Field Summary
protected  int id
          The server's id in the range of [1, l].
private static long serialVersionUID
          This Serial ID
protected  java.math.BigInteger si
          The secret share.
 
Fields inherited from class paillierp.key.PaillierThresholdKey
delta, l, v, vi, w
 
Fields inherited from class paillierp.key.PaillierKey
k, MAX_KEY_SIZE, n, nPlusOne, ns, nSPlusOne, rnd
 
Constructor Summary
PaillierPrivateThresholdKey(java.math.BigInteger n, int l, java.math.BigInteger combineSharesConstant, int w, java.math.BigInteger v, java.math.BigInteger[] viarray, java.math.BigInteger si, int i, long seed)
          Creates a new private key for the generalized Paillier threshold scheme from the given modulus n, for use on l decryption servers, w of which are needed to decrypt any message encrypted by using this private key.
PaillierPrivateThresholdKey(java.math.BigInteger n, int l, int w, java.math.BigInteger v, java.math.BigInteger[] viarray, java.math.BigInteger si, int i, long seed)
          Creates a new private key for the generalized Paillier threshold scheme from the given modulus n, for use on l decryption servers, w of which are needed to decrypt any message encrypted by using this public key.
PaillierPrivateThresholdKey(byte[] b, long seed)
          Creates a new private key using a byte encoding of a key.
 
Method Summary
 boolean canEncrypt()
          Describes if this key can be used to encrypt
 int getID()
          Returns the id of this private key.
 java.math.BigInteger getSi()
          Returns the secret share key which corresponds to this private key package.
 byte[] toByteArray()
          Encodes this key into a byte array.
 
Methods inherited from class paillierp.key.PaillierThresholdKey
getCombineSharesConstant, getDelta, getL, getThresholdKey, getV, getVi, getW
 
Methods inherited from class paillierp.key.PaillierKey
getK, getN, getNPlusOne, getNS, getNSPlusOne, getPublicKey, getRandomModN, getRandomModNSPlusOneStar, getRandomModNStar, getRnd, inModN, inModN, inModNS, inModNSPlusOne, inModNSPlusOneStar, inModNStar, inModNStar, isCiphertext, isPlaintext, setRnd, setRnd, updateRnd
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
This Serial ID

See Also:
Constant Field Values

si

protected java.math.BigInteger si
The secret share. This is unique among the L decryption servers.


id

protected int id
The server's id in the range of [1, l]. This identifies which verification key vi[id] to use.

Constructor Detail

PaillierPrivateThresholdKey

public PaillierPrivateThresholdKey(java.math.BigInteger n,
                                   int l,
                                   int w,
                                   java.math.BigInteger v,
                                   java.math.BigInteger[] viarray,
                                   java.math.BigInteger si,
                                   int i,
                                   long seed)
Creates a new private key for the generalized Paillier threshold scheme from the given modulus n, for use on l decryption servers, w of which are needed to decrypt any message encrypted by using this public key. The values v and vi correspond to the public values v and vi=vl!si needed to verify the zero knowledge proofs. si is the secret share for this decryption key, and i is the ID.

Parameters:
n - a safe prime product of p and q where p'=(p-1)/2 and a'=(a-1)/2 are also both primes
l - number of decryption servers
w - threshold of servers needed to successfully decrypt any ciphertext created by this public key. Note that wl/2.
v - a generator of a cyclic group of squares in Z*n2
viarray - array of verification keys where vi[i] is vl!si where si is the private key for decryption server i
si - secret share for this server
i - ID of the decryption server (from 1 to l)
seed - a long integer needed to start a random number generator

PaillierPrivateThresholdKey

public PaillierPrivateThresholdKey(java.math.BigInteger n,
                                   int l,
                                   java.math.BigInteger combineSharesConstant,
                                   int w,
                                   java.math.BigInteger v,
                                   java.math.BigInteger[] viarray,
                                   java.math.BigInteger si,
                                   int i,
                                   long seed)
Creates a new private key for the generalized Paillier threshold scheme from the given modulus n, for use on l decryption servers, w of which are needed to decrypt any message encrypted by using this private key. The values v and vi correspond to the public values v and vi=vl!si needed to verify the zero knowledge proofs. si is the secret share for this decryption key, and i is the ID.

Parameters:
n - a safe prime product of p and q where p'=(p-1)/2 and a'=(a-1)/2 are also both primes
l - number of decryption servers
combineSharesConstant - precomputed value (4*l!)-1 mod n
w - threshold of servers needed to successfully decrypt any ciphertext created by this public key. Note that wl/2.
v - a generator of a cyclic group of squares in Z*n2
viarray - array of verification keys where vi[i] is vl!si where si is the private key for decryption server i
si - secret share for this server
i - ID of the decryption server (from 1 to l)
seed - a long integer needed to start a random number generator

PaillierPrivateThresholdKey

public PaillierPrivateThresholdKey(byte[] b,
                                   long seed)
Creates a new private key using a byte encoding of a key.

Parameters:
b - Byte array of the necessary values of this private key
seed - a long integer needed to start a random number generator
See Also:
toByteArray()
Method Detail

canEncrypt

public boolean canEncrypt()
Describes if this key can be used to encrypt

Overrides:
canEncrypt in class PaillierKey
Returns:
'true' if it can encrypt.

getSi

public java.math.BigInteger getSi()
Returns the secret share key which corresponds to this private key package. This was generated and given to this decryption server.

Returns:
secret share of this decryption server

getID

public int getID()
Returns the id of this private key. Mostly used to identify which verification key in PaillierThresholdKey.vi corresponds with this private key.

Returns:
ID of the decryption server's private key

toByteArray

public byte[] toByteArray()
Encodes this key into a byte array. As this is a public threshold key, the public modulo n, l, w, v, vi, id, and si will be encoded in that order. Further, before each BigInteger (except n) is the 4-byte equivalent to the size of the BigInteger for later parsing.

Overrides:
toByteArray in class PaillierThresholdKey
Returns:
A byte array containing the most necessary values of this key. A byte array of size 0 is returned if the key would be too large.
See Also:
PaillierPrivateThresholdKey(byte[], long), BigInteger.toByteArray()