Fix spelling/naming issues, slightly more robust testing of encryption and decryption. #12

Closed
sachaservan wants to merge 7 commits from master into master
pull from: master
2 changed files with 11 additions and 11 deletions
Showing only changes of commit d2aad1b7fb - Show all commits

No files matched your search

+3 -3
View File
@@ -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:
+8 -8
View File
@@ -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)
}
}