|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectpaillierp.zkp.ZKP
paillierp.zkp.MultiplicationZKP
public class MultiplicationZKP
A non-interactive Zero Knowledge Proof that the multiplication of a ciphertext is done. This Zero Knowledge Proof will correctly validate whether the message of the ciphertext E(a) was indeed multiplied by a constant α. This is done without revealing the value α and without interaction.
The protocol is given on p. 40 in Multiparty Computation from Threshold Homomorphic Encryption by Cramer, Damgård, and Nielsen.
| Field Summary | |
|---|---|
private java.math.BigInteger |
a
A random encryption of E(xa) for chosen x. |
private java.math.BigInteger |
b
A random encryption of x. |
private java.math.BigInteger |
c
A random encryption of α. |
private java.math.BigInteger |
ca
The original encryption E(a). |
private java.math.BigInteger |
d
A random encryption of E(a&alpha). |
private java.math.BigInteger |
n
The public key modulo. |
private java.math.BigInteger |
nSPlusOne
The public key modulo to the s+1 power. |
private static long |
serialVersionUID
This Serial ID |
private java.math.BigInteger |
w
x+eα mod n |
private java.math.BigInteger |
y
vCatγe mod n2 |
private java.math.BigInteger |
z
usegt mod n2 |
| Fields inherited from class paillierp.zkp.ZKP |
|---|
hashFunction |
| Constructor Summary | |
|---|---|
MultiplicationZKP(byte[] b)
Creates an instance of the Zero Knowledge Proof of decryption from a byte array which does have the key encoded. |
|
MultiplicationZKP(byte[] b,
java.math.BigInteger nSPlusOne,
java.math.BigInteger n)
Creates an instance of the Zero Knowledge Proof from a byte array (which does not have the key) and the values necessary for verification. |
|
MultiplicationZKP(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. |
|
MultiplicationZKP(PaillierKey key,
java.math.BigInteger ca,
java.math.BigInteger alpha)
Computes a random encryption of αa where a is the message encrypted in ca. |
|
| Method Summary | |
|---|---|
java.math.BigInteger |
getValue()
A random encryption of aα. |
byte[] |
toByteArray()
Encodes this ZKP into a byte array. |
byte[] |
toByteArrayNoKey()
Encodes this ZKP into a byte array. |
boolean |
verify()
Verifies if all of the above integers are indeed true, thereby showing that this multiplication is exact. |
boolean |
verifyKey(PaillierKey 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
private java.math.BigInteger ca
private java.math.BigInteger c
private java.math.BigInteger d
private java.math.BigInteger a
private java.math.BigInteger b
private java.math.BigInteger w
private java.math.BigInteger y
private java.math.BigInteger z
private java.math.BigInteger n
private java.math.BigInteger nSPlusOne
| Constructor Detail |
|---|
public MultiplicationZKP(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 MultiplicationZKP(byte[] b,
java.math.BigInteger nSPlusOne,
java.math.BigInteger n)
b, then
those values are used.
b - byte array of the necessary values for a ZKPnSPlusOne - the public key modulus ns+1n - the public key modulus ntoByteArrayNoKey()
public MultiplicationZKP(byte[] b,
PaillierThresholdKey pubkey)
b, then those
values are used.
b - byte array of the necessary values for a ZKPpubkey - public Paillier key to provide further recurring
values for a ZKPtoByteArrayNoKey()
public MultiplicationZKP(PaillierKey key,
java.math.BigInteger ca,
java.math.BigInteger alpha)
ca. This additionally sets up a
Zero Knowledge Proof that this multiplication was done, without revealing
anything of α.
key - Public key n under which ca was encryptedca - The encryption E(a, r)alpha - The constant α| Method Detail |
|---|
public java.math.BigInteger getValue()
getValue in class ZKPpublic boolean verify()
verify in class ZKPpublic boolean verifyKey(PaillierKey origkey)
origkey -
public byte[] toByteArray()
n) is the 4-byte
equivalent to the size of the BigInteger for later parsing.
toByteArray in class ZKPMultiplicationZKP(byte[]),
BigInteger.toByteArray()public byte[] toByteArrayNoKey()
n) is the 4-byte
equivalent to the size of the BigInteger for later parsing.
toByteArrayNoKey in class ZKPMultiplicationZKP(byte[], PaillierThresholdKey),
BigInteger.toByteArray()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||