Evaluation key management for lwe dialect
- Dominant language
- MLIR
- Stars
- 906
- Forks
- 171
- Avg merge
- 4d 12h
- Merged PRs (30d)
- 32
Description
`bgv.relinearize` / `bgv.rotate` currently can not be lowered to lwe and further polynomial dialect. The problem here is that the lwe dialect lacks the information of the evaluation key for multiplication/rotation.
For lowering to openfhe, it is solved by a `--openfhe-configure-crypto-context` pass (#696) that creates a `!openfhe.crypto_context` and it was further passed to other openfhe arithmetic ops.
If we follow the same methodology, it can be breaks down into the following steps.
* Add `LWEContext` and `LWEEvaluationKey`
* Configure `LWEContext` via a pass like the openfhe one
* Add ops like `lwe.gen_mulkey` and `lwe.gen_rotkey`
* Add `LWEContext` as argument to the entry function and `bgv-to-lwe` will extract `LweEvaluationKey` from it
I wonder if this is a desired approach to the problem and want to know maintainer's thoughts about this (I searched about how to materialize relinearize/keyswitching in the issues but found little discussion on it).
Contributor guide
Assessment
This issue has not been assessed yet.