Fix spelling/naming issues, slightly more robust testing of encryption and decryption. #12
No files matched your search
+3
-3
@@ -171,7 +171,7 @@ func (tk *ThresholdPublicKey) VerifyDecryption(encryptedMessage, decryptedMessag
|
||||
return nil
|
||||
}
|
||||
|
||||
// Private key for a threshold Paillier scheme. Holds skate information
|
||||
// Secret key for a threshold Paillier scheme. Holds skate information
|
||||
// for the given decryption server.
|
||||
// `Id` is the unique identifier of a decryption server and `Share` is a secret
|
||||
// share generated from hiding polynomial and is used for a partial share decryption.
|
||||
@@ -297,7 +297,7 @@ type PartialDecryption struct {
|
||||
//
|
||||
// In our case:
|
||||
//
|
||||
// Decryption server i wants to prove that he indeed raised the cyphertext to
|
||||
// Decryption server i wants to prove that he indeed raised the ciphertext to
|
||||
// his secret exponent s_i during partial decryption.
|
||||
// This is essentialy a protocol for the equality of discrete logs,
|
||||
// log_{c^4}(c_i^2) = log_v(v_i).
|
||||
@@ -309,7 +309,7 @@ type PartialDecryption struct {
|
||||
// E = HASH(a, b, c^4, c_i^2), where
|
||||
// a = (c^4)^r mod n^2
|
||||
// b = V^r mod n^2
|
||||
// c is a cyphertext,
|
||||
// c is a ciphertext,
|
||||
// V is a generator from ThresholdKey.V
|
||||
// c_i is a partial decryption for this server
|
||||
// - Compute Z as:
|
||||
|
||||
@@ -234,7 +234,7 @@ func TestEncryptingDecrypting(t *testing.T) {
|
||||
t.Error(err)
|
||||
}
|
||||
if n(message) != n(message2) {
|
||||
t.Error("The decrypted cyphered is not original massage but ", message2)
|
||||
t.Error("The decrypted ciphered is not original massage but ", message2)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -249,13 +249,13 @@ func TestHomomorphicThresholdEncryption(t *testing.T) {
|
||||
plainText1 := b(13)
|
||||
plainText2 := b(19)
|
||||
|
||||
cypher1, _ := tpks[0].Encrypt(plainText1, rand.Reader)
|
||||
cypher2, _ := tpks[1].Encrypt(plainText2, rand.Reader)
|
||||
cipher1, _ := tpks[0].Encrypt(plainText1, rand.Reader)
|
||||
cipher2, _ := tpks[1].Encrypt(plainText2, rand.Reader)
|
||||
|
||||
cypher3 := tpks[0].Add(cypher1, cypher2)
|
||||
cipher3 := tpks[0].Add(cipher1, cipher2)
|
||||
|
||||
share1 := tpks[0].Decrypt(cypher3.C)
|
||||
share2 := tpks[1].Decrypt(cypher3.C)
|
||||
share1 := tpks[0].Decrypt(cipher3.C)
|
||||
share2 := tpks[1].Decrypt(cipher3.C)
|
||||
|
||||
combined, _ := tpks[0].CombinePartialDecryptions([]*PartialDecryption{share1, share2})
|
||||
|
||||
@@ -321,7 +321,7 @@ func TestCombinePartialDecryptionsZKP(t *testing.T) {
|
||||
t.Error(err)
|
||||
}
|
||||
if n(message) != n(message2) {
|
||||
t.Error("The decrypted cyphered is not original massage but ", message2)
|
||||
t.Error("The decrypted ciphered is not original massage but ", message2)
|
||||
}
|
||||
share1.E = b(687687678)
|
||||
_, err = tpks[0].CombinePartialDecryptionsZKP([]*PartialDecryptionZKP{share1, share2})
|
||||
@@ -357,7 +357,7 @@ func TestCombinePartialDecryptionsWith100Shares(t *testing.T) {
|
||||
t.Error(err)
|
||||
}
|
||||
if n(message) != n(message2) {
|
||||
t.Error("The decrypted cyphered is not original massage but ", message2)
|
||||
t.Error("The decrypted ciphered is not original massage but ", message2)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user