microsoft / SEAL

Microsoft SEAL is an easy-to-use and powerful homomorphic encryption library.
https://www.microsoft.com/en-us/research/group/cryptography-research/
MIT License
3.62k stars 711 forks source link

dot product with BFV #571

Open Cocchi34 opened 2 years ago

Cocchi34 commented 2 years ago

Hi! I'm new to the library, so I'm trying implementing dot product between two vector (one ciphertext with one plaintext) using BFV scheme. After doing multiply_plain_inplace, how can I sum the value in the resulting vector?

I've tried using add_many but occurs the following error: no viable conversion from 'seal::Ciphertext' to 'const std::vector'

Ideas? Thanks

fionser commented 2 years ago

You need to rotate the encoded vector and perform the sum to achieve "dot-product". Check the paper "Algorithms in HElib"