zama-ai / tfhe-rs

TFHE-rs: A Pure Rust implementation of the TFHE Scheme for Boolean and Integer Arithmetics Over Encrypted Data.
Other
906 stars 143 forks source link

feat(core): add keyswitch that changes the scalar type from input to output #1199

Closed IceTDrinker closed 3 months ago

IceTDrinker commented 4 months ago

refs: https://github.com/zama-ai/tfhe-rs-internal/issues/526

PR content/description

Add a separate function for switching Scalar types between input and ouptut while keyswitching.

I have preferred this approach for now as it was making the bounds and the code way more convoluted in the existing keyswitch.

But if we think it's better to put it in the same function I can.

A follow-up PR will do that for the PBS but should be much easier to write as the two types do not interact at all (as everything happens in the fourier domain), here we need to cast to make computations with both types

Check-list: