Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CKKS compatibility #36

Open
SetarehGhorshi opened this issue Feb 14, 2025 · 6 comments
Open

CKKS compatibility #36

SetarehGhorshi opened this issue Feb 14, 2025 · 6 comments

Comments

@SetarehGhorshi
Copy link

Hello,

I was wondering if this code can easily be modified to support ckks? If so, what are the required changes?

Thanks.

@enricobottazzi
Copy link
Member

Yes, definitely. I don't know how easily though. It would require to write a circuit that encodes the CKKS encryption algorithm. Is it similar to BFV encryption?

@SetarehGhorshi
Copy link
Author

SetarehGhorshi commented Feb 15, 2025

Thanks for answering.

I am asking this since in the conclusion section of the reference paper it is mentioned that :
"A further step is to adapt the techniques described above to other FHE schemes, such as CKKS or TFHE/FHEW. In particular, in CKKS, the message needs to be encoded using FFT, which is not trivial to prove."

However, in the readme of this repository, it is mentioned that "Note that this can be also generalized to any RLWE-based algorithms."
Therefore, I was wondering how I can generalize this code to work with CKKS and if there are any plans to implement this as mentioned in the paper.
I think the main differences between BFV and CKKS are the FFT encoding and CKKS being approximate.

@enricobottazzi
Copy link
Member

enricobottazzi commented Feb 15, 2025

I suggest you trying to get in touch with these guys https://github.com/ZK-Strapping/zkllvm-fft @xiangxiecrypto. They would know better than me

@SetarehGhorshi
Copy link
Author

Hello @xiangxiecrypto. I was wondering if you could please help me with this. I am trying to find a ready-to-use ckks zkp generator (for generating proof of correct encryption) or modify a similar repo to support ckks as well. I tried modifying this code but had no luck in making it work. I am now looking into https://github.com/ZK-Strapping/zkllvm-fft as suggested but will appreciate any other help or suggestion you might have.

@xiangxiecrypto
Copy link

Hello @xiangxiecrypto. I was wondering if you could please help me with this. I am trying to find a ready-to-use ckks zkp generator (for generating proof of correct encryption) or modify a similar repo to support ckks as well. I tried modifying this code but had no luck in making it work. I am now looking into https://github.com/ZK-Strapping/zkllvm-fft as suggested but will appreciate any other help or suggestion you might have.

Hey, I think it is hard to directly extend greco to ckks for generating proof of correct encryption. The reason is that the encoding algorithm in ckks has to use FFT over real numbers (not some number over fields). I did not find any implementation on this, all related repos are proving FFT over fields which is somehow easier to prove.

Some ideas in my mind are that you can leverage techs from zkml, because they are also trying to prove floating numbers. You can refer to our zkCNN paper to find some similar ideas.

@xiangxiecrypto
Copy link

If you can prove FFT over real numbers, you can also prove homomorphic operations on TFHE with power-of-two modulus.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants