|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpaillierp.zkp.ZKP
paillierp.zkp.DecryptionZKP
public class DecryptionZKP
A non-interactive Zero Knowledge Proof that some partial decryption was done. (Note that this is only for the threshold version of the scheme.) This is essentially a protocol for the equality of discrete logs, i.e. given u, u', v, v', prove that logu(u') = logv(v'). This Zero Knowledge Proof will correctly validate whether the ciphertext c was indeed raised to the 2Δsi power by comparing it with the public verification vi. This checks that logc4(ci2) = logv(vi). Recall that vi = vΔsi.
The protocol is given on pp. 16-17 in Generalization of Paillier's Public-Key System with Applications to Electronic Voting by Damgård et al.
PaillierThreshold
,
Serialized FormField Summary | |
---|---|
protected java.math.BigInteger |
c
The original ciphertext. |
protected java.math.BigInteger |
c4
The ciphtertext to the fourth power. |
protected PartialDecryption |
ci
This share's decryption of c . |
protected java.math.BigInteger |
ci2
The share's decryption of c , but squared, for the protocol. |
protected java.math.BigInteger |
e
The hash of the correctness. |
protected java.math.BigInteger |
nSPlusOne
The public key value. |
private static long |
serialVersionUID
This Serial ID |
protected java.math.BigInteger |
v
The overall verification number. |
protected java.math.BigInteger |
vi
The share's verification number. |
protected java.math.BigInteger |
z
The value necessary to check the correctness of this decryption. |
Fields inherited from class paillierp.zkp.ZKP |
---|
hashFunction |
Constructor Summary | |
---|---|
DecryptionZKP(byte[] b)
Creates an instance of the Zero Knowledge Proof of decryption from a byte array which does have the key encoded. |
|
DecryptionZKP(byte[] b,
java.math.BigInteger nSPlusOne,
java.math.BigInteger v,
java.math.BigInteger vi)
Creates an instance of the Zero Knowledge Proof from a byte array (which does not have the key) and the values necessary for verification. |
|
DecryptionZKP(byte[] b,
PaillierThresholdKey pubkey)
Creates an instance of the Zero Knowledge Proof from a byte array (which does not have the key) and a public key. |
|
DecryptionZKP(PaillierPrivateThresholdKey deckey,
java.math.BigInteger c)
Creates an instance of the Zero Knoweledge Proof and partial decryption. |
Method Summary | |
---|---|
java.math.BigInteger |
getC()
Returns the original ciphertext. |
int |
getID()
Returns the ID of the key used to make this partial decryption. |
PartialDecryption |
getPartialDecryption()
|
java.math.BigInteger |
getValue()
The partial decryption intended to be delivered. |
byte[] |
toByteArray()
Encodes this ZKP into a byte array. |
byte[] |
toByteArrayNoKey()
Encodes this ZKP into a byte array. |
boolean |
verify()
Evaluates the truth of this partial decryption. |
boolean |
verify(java.math.BigInteger origc)
Evaluates the truth of this partial decryption as a partial decryption of origc . |
boolean |
verifyKey(PaillierThresholdKey origkey)
Verifies that the values used in this Zero Knowledge Proof corresponds to the given key. |
Methods inherited from class paillierp.zkp.ZKP |
---|
hash |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
protected java.math.BigInteger e
protected java.math.BigInteger z
protected java.math.BigInteger c
protected java.math.BigInteger c4
protected PartialDecryption ci
c
. That is,
ci
= c
2Δsi.
protected java.math.BigInteger ci2
c
, but squared, for the protocol.
protected java.math.BigInteger nSPlusOne
protected java.math.BigInteger v
protected java.math.BigInteger vi
Constructor Detail |
---|
public DecryptionZKP(byte[] b)
b
- byte array of the necessary values for a ZKP
java.lang.IllegalArgumentException
- if it detects that some corruption has
occured, for example, if the "size of next BigInteger"
field is a larger number than typical causing out of
bounds issues.toByteArray()
public DecryptionZKP(byte[] b, java.math.BigInteger nSPlusOne, java.math.BigInteger v, java.math.BigInteger vi)
b
- byte array of the necessary values for a ZKPnSPlusOne
- the public key modulus ns+1v
- the public key verifier for partial decryptionsvi
- the public key verifier for partial decryptions from
this particular servertoByteArrayNoKey()
public DecryptionZKP(byte[] b, PaillierThresholdKey pubkey)
b
- byte array of the necessary values for a ZKPpubkey
- public Paillier key to provide further recurring
values for a ZKPtoByteArrayNoKey()
public DecryptionZKP(PaillierPrivateThresholdKey deckey, java.math.BigInteger c)
deckey
- Private key used to generate a partial decryptionc
- Ciphertext to be decryptedMethod Detail |
---|
public boolean verify()
verify
in class ZKP
public boolean verify(java.math.BigInteger origc)
origc
. By recomputing the hash,
it checks to see that indeed ci was computed correctly
from origc
.
origc
- Original Ciphertext.
origc
.public boolean verifyKey(PaillierThresholdKey origkey)
origkey
- Original key
origkey
public java.math.BigInteger getC()
public int getID()
public java.math.BigInteger getValue()
getValue
in class ZKP
PaillierThreshold.decrypt(BigInteger)
public PartialDecryption getPartialDecryption()
public byte[] toByteArray()
n
) is the 4-byte
equivalent to the size of the BigInteger for later parsing.
toByteArray
in class ZKP
DecryptionZKP(byte[])
,
BigInteger.toByteArray()
public byte[] toByteArrayNoKey()
n
) is the 4-byte
equivalent to the size of the BigInteger for later parsing.
toByteArrayNoKey
in class ZKP
DecryptionZKP(byte[], PaillierThresholdKey)
,
BigInteger.toByteArray()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |