-
-
Notifications
You must be signed in to change notification settings - Fork 65
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
How to get the coefficient of ciphertext? #121
Comments
Sorry for replying late, the data() function returns a pointer to the beginning of the ciphertext data, which we think might not be safe, so you can write a lambda function like "to_string" to get the data you want. |
Thank you for your reply! I saw the relevant ciphertext storage method in the 7_serialization.py file. But there is one question that puzzles me. When my ciphertext modulus is set to [60,40,40,60] and the polynomial order is set to 16384, and referring to the original SEAL code, it defines the coefficient type as uint64_t. If I am not mistaken, the ciphertext coefficients have a total of 64 bits163844/8=524288 bytes. But when I use the os.path.getsize() function to get the size of the 'cipher,bin' file, the data I get does not match it, so I would like to ask if the 'cipher.bin' file only contains the ciphertext coefficient data? |
Not, the to_string method will serialize the data and it has the SEAL header, params, and data. |
Then I still can't get the coefficients of the ciphertext. In the original SEAL library, the variable 'data_' that stores the ciphertext coefficients is a private variable of the 'Ciphertext' class. The 'data()' function returns a pointer, which is not supported by Python. So what should I do? |
write a function like this:
|
I tried using the original SEAL library, which defines a data() function in the Ciphertext class that returns the coefficients of the ciphertext. However, I saw in "wrapper.cpp" that SEAL-Python does not seem to include this function.
The text was updated successfully, but these errors were encountered: