google / fully-homomorphic-encryption

An FHE compiler for C++
Apache License 2.0
3.52k stars 256 forks source link

What exactly is `key.cloud()` #76

Closed tavurth closed 9 months ago

tavurth commented 9 months ago

Was reading through some of the examples and found the key.cloud() to be an interesting and yet missing part of the documentation.

I only found this information

What exactly is key.cloud() doing?

Perhaps there are some other references I could look into?

j2kun commented 9 months ago

That is part of the TFHE API. The transpiler emits code for a single function written against an external API, such as TFHE or OpenFHE. You still have to build the rest of the program.

If you're interested, you may want to check out our next generation compiler, https://github.com/google/heir

tavurth commented 9 months ago

@j2kun my query was more: "How does a cloud key function, and what is it?"

Perhaps you have some reference docs on how a cloud key functions enabling such operation on the encrypted data?

As example:

We encrypt the input:

https://github.com/google/fully-homomorphic-encryption/blob/ca42d00e02edde06a6aa8b76b9ced88a0aa20dab/transpiler/examples/hangman/hangman_client_main.cc#L73

We check to see if the letter was in the encrypted state:

https://github.com/google/fully-homomorphic-encryption/blob/ca42d00e02edde06a6aa8b76b9ced88a0aa20dab/transpiler/examples/hangman/hangman_client_main.cc#L83

https://github.com/google/fully-homomorphic-encryption/blob/ca42d00e02edde06a6aa8b76b9ced88a0aa20dab/transpiler/examples/hangman/hangman_api.cc#L18

"How does a cloud key function", or "What the hell is a cloud key and why is it required" is more my question?

Please excuse my ignorance, I'm just interested in how this works behind the scenes, and the code in the linked repos is quite dense to figure out what key.cloud() is actually doing.