google / heir

A compiler for homomorphic encryption
https://heir.dev/
Apache License 2.0
309 stars 46 forks source link

Support encoding short tensors into BGV ciphertexts of restricted dimension #645

Open j2kun opened 5 months ago

j2kun commented 5 months ago

OpenFHE's MakePackedPlaintext will zero-pad to the ring degree N, and this breaks the rotate-and-reduce trick, so instead in the simple_sum_test.cpp test harness, I manually repeat the coefficients cyclically until it fills the whole ciphertext. I'd like to add this to the compilation pipeline and the encode helper, and it suggests a bunch more work to do if we have an input cleartext tensor that is not divisible by the OpenFHE's ring degree (rotate-and-reduce tricks won't work in that case, or will have to be tweaked to account for the true underlying ring degree).

So this breaks down into two pieces:

j2kun commented 5 months ago

The solution may also be related to https://github.com/google/heir/issues/646, since in that ticket a single scalar value can be encoded by repetition.

github-actions[bot] commented 5 months ago

This issue has 5 outstanding TODOs:

This comment was autogenerated by todo-backlinks