math icon indicating copy to clipboard operation
math copied to clipboard

NTT Implementation for PolynomialRingZq

Open Marvin-Beckmann opened this issue 1 year ago • 0 comments

Description

This PR implements the NTT for

  • [x] Cyclic Modulus
  • [x] Negacyclic Modulus
  • [x] multiplication of PolynomialRingZq

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

  • [x] I added basic working examples (possibly in doc-comment)
  • [x] I triggered all possible errors in my test in every possible way
  • [x] I included tests for all reasonable edge cases

Checklist:

  • [x] I have performed a self-review of my own code
    • [x] The code provides good readability and maintainability s.t. it fulfills best practices like talking code, modularity, ...
      • [x] The chosen implementation is not more complex than it has to be
    • [x] My code should work as intended and no side effects occur (e.g. memory leaks)
    • [x] The doc comments fit our style guide
    • [x] I have credited related sources if needed

Marvin-Beckmann avatar Feb 25 '25 14:02 Marvin-Beckmann