microsoft / SEAL

Microsoft SEAL is an easy-to-use and powerful homomorphic encryption library.
https://www.microsoft.com/en-us/research/group/cryptography-research/
MIT License
3.58k stars 709 forks source link

I want to understand the algorithm of the functions in SEAL, but I can't. #528

Open nabe114514 opened 2 years ago

nabe114514 commented 2 years ago

I research on CKKS homomorphic encryption using SEAL, in graduate school. I want to rewrite some functions to primitive types in C++. I would like to understand the structure of the rescale function, however I do not understand how the function is formed due to SEAL being a useful library. For example, I would like to understand about the following functions.

evaluator.rescale_to_next_inplace(ciphertext);

From this function, I do not understand how the function is created. Which header file in SEAL should I look at to find out about rescale? ,or how can I write the rescale using only C++ functions?

WeiDaiWD commented 2 years ago

Sorry, I don't get your question. Have you failed to search for this function in your copy of SEAL? Then you must have an incomplete copy of SEAL. Also what do you mean by "C++ functions"?

nabe114514 commented 2 years ago

Thanks for the reply.

I am writing the program code with reference to the paper. The paper stated that it was necessary to convert from proprietary data types defined inside SEAL to the corresponding C++ primitive types. I assumed that the proprietary data and primitive types were the following proprietary data → seal::(function) primitive types → std::(function) The reason why I asked this question in the first place is that I would like to migrate the rescale process to GPUs with reference to the paper. In order to put the rescale process on the GPU, the paper said that they need to be converted to primitive types. Perhaps this is not a question that should be asked here. However, I asked the question in the hope of gaining some useful information.The reason why I asked this question in the first place is that I would like to migrate the rescale process to GPUs with reference to the paper. In order to put the rescale process on the GPU, the paper said that they need to be converted to primitive types. Perhaps this is not a question that should be asked here. However, I asked the question in the hope of gaining some useful information.

p.s. If I am not able to check inside SEAL, which file in the SEAL library should I check for functions I don't know the details of (e.g., evaluator.rescale_to_next_inplace)?

WeiDaiWD commented 2 years ago

https://github.com/microsoft/SEAL/blob/82b07db635132e297282649e2ab5908999089ad2/native/src/seal/evaluator.cpp#L1441

nabe114514 commented 2 years ago

Thank you. I'm going to try to find out where that is.