Better explanation of an additively homomorphic property

This commit is contained in:
Piotr Dyraga committed 2018-06-28 15:46:45 +02:00
1 parent 053ae45b59
commit 5631d7cca5
1 file changed
+4 -1
+4 -1
View File
@@ -44,7 +44,10 @@ func (pub *PublicKey) Encrypt(m *big.Int, random io.Reader) (*Cypher, error) {
// their sum.
//
// It's possible because Paillier is a homomorphic encryption scheme, where
// E(m1) * E(m2) = E(m1 + m2)
// the product of two ciphertexts will decrypt to the sum of their corresponding
// plaintexts:
//
// D( (E(m1) * E(m2) mod n^2) ) = m1 + m2 mod n
func (pub *PublicKey) Add(cypher ...*Cypher) *Cypher {
accumulator := big.NewInt(1)