heir icon indicating copy to clipboard operation
heir copied to clipboard

Support encoding short tensors into BGV ciphertexts of restricted dimension

Open j2kun opened this issue 1 year ago • 3 comments

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:

  • Support auto-generating the cyclic repetition code in the add-client-interface helper
  • Determine how to handle inputs that are not divisible by the RLWE tensor size used by a backend (this dips into issues with parameter selection)

j2kun avatar Apr 24 '24 19:04 j2kun

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.

j2kun avatar Apr 24 '24 19:04 j2kun

This issue has 7 outstanding TODOs:

This comment was autogenerated by todo-backlinks

github-actions[bot] avatar Apr 25 '24 14:04 github-actions[bot]