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

Polyarrays created from ciphertexts/public keys are converted out of NTT on creation #4

Merged
merged 3 commits into from
Aug 10, 2023

Conversation

ryanorendorff
Copy link
Collaborator

Public keys were always stored in NTT form, and hence need to be converted out of that form in order to use them with other components that are also not in NTT form.

Additionally adds a predicate to determine if a public key is in NTT form. This should always be true but can be a good check to ensure that if the public key is converted at any point that it should be returned back to NTT form.

Switches the polynomial array down one modulus by dropping the last modulus
in the set.
*/
PolynomialArray PolynomialArray::drop() const {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently this method is not used. I was using it when I was converting the underlying public key ciphertext from a higher modulus to a lower modulus, but the current implementation (using first_context_data instead of key_context_data already does this drop for us). Leaving this here in case we need it later. I have a test in Rust that ensures it does the correct thing.

@ryanorendorff ryanorendorff merged commit 37e21e7 into sunscreen Aug 10, 2023
1 check passed
@ryanorendorff ryanorendorff deleted the ntt-conversion branch August 10, 2023 16:21
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

Successfully merging this pull request may close these issues.

2 participants