-
Notifications
You must be signed in to change notification settings - Fork 2
NTT Implementation for PolynomialRingZq #462
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
base: dev
Are you sure you want to change the base?
Conversation
…ations within the math crate
…ke benchmarks easier to read
…cation, addition and subtraction operations
/// This function allows to initialize a [`NTTBasisPolynomialRingZq`] | ||
/// object. | ||
/// We currently only allow for two kinds of moduli to accompany the construction: | ||
/// It must be either cyclotomic (`X^n - 1`) or negacyclic (`X^n + 1`) convoluted wrapping (also submitted in the algorithm) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cyclic
/// Parameters: | ||
/// - `n`: the degree of the polynomial | ||
/// - `root_of_unity`: the `n`-th or `2n`-th root of unity | ||
/// - `q`: the modulus of the cyclotomic polynomial |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Misleading to call it cyclotomic because it only applies to one case?
/// This function essentially computes the included butterliy computations for each provided | ||
/// chunk. | ||
/// The chunk is double the size of the stride. | ||
/// The computation currently performs the standard butterly operation from Gentleman-Sande. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
butterfly, see first sentence as well
} | ||
res | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests missing for intt working correctly as well as different modulus (as in ntt)
Description
This PR implements the NTT for
Even though I included several optimisations I found, I did not manage to make the implication faster than direct multiplication using FLINT, where the multiplication is already very fast.
I included benchmarks and added an additional disclaimer in the comment of the NTT-multiplication that is is not slower.
I tested it for common parameter-sets that I have found.
I found that the overhead necessary for multithreading also exceeds the runtime of the multiplication, so this was not an option to reduce the runtime, but for future potential optimisations I kept the framework to enable multi-threading within the code-base.
Testing
Checklist: