sachaservan / bgn

BGN encryption scheme implementation using Go
16 stars 6 forks source link

BGN Multiplying Plaintexts #1

Closed lemonviv closed 4 years ago

lemonviv commented 5 years ago

Dear Sacha,

I notice that in the main function, there is a test that a ciphertext after multiplication can also be multiplied by a plaintext (similar to the Paillier cryptosystem), i.e.,

const1 := big.NewFloat(88.0) r2 := pk.EMultC(c2, const1) fmt.Printf("EMULTC E(%s) ⊠ %f = E(%s)\n\n", m2, const1, sk.Decrypt(r2, pk).String()) r3 := pk.EMult(c3, c4) dr3 := sk.Decrypt(r3, pk) fmt.Printf("EMULT E(%s) ⊠ E(%s) = E(%s)\n\n", m3, m4, sk.Decrypt(r3, pk).String())

So, does it mean that BGN can support arbitrary times of addition and partial multiplication (with plaintexts), as well as one multiplication between ciphertexts? I didn't see the original BGN paper claim the partial multiplication functionalities.

Thanks and best regards, Yuncheng

sachaservan commented 4 years ago

Yes, that's correct. BGN supports one encrypted multiplication by another encrypted value and an arbitrary number of multiplications by constant (non-encrypted) values.