Home > Backend Development > C++ > How Can I Optimize My Number Theoretic Transform (NTT) and Modular Arithmetic for Fast Squaring of Very Large Numbers?

How Can I Optimize My Number Theoretic Transform (NTT) and Modular Arithmetic for Fast Squaring of Very Large Numbers?

Linda Hamilton
Release: 2024-12-18 16:56:11
Original
890 people have browsed it

How Can I Optimize My Number Theoretic Transform (NTT) and Modular Arithmetic for Fast Squaring of Very Large Numbers?

Modular arithmetics and NTT (finite field DFT) optimizations

Problem: I wanted to use NTT for fast squaring (see Fast bignum square computation), but the result is slow even for really big numbers .. more than 12000 bits.

So my question is:


  1. Is there a way to optimize my NTT transform?

    I did not mean to speed it by parallelism (threads); this is low-level layer only.

  2. Is there a way to speed up my modular arithmetics?

This is my (already optimized) source code in C for NTT (it's complete and 100% working in C whitout any need for third-party libs and should also be thread-safe. Beware the source array is used as a temporary!!!, Also it cannot transform the array to itself).

The above is the detailed content of How Can I Optimize My Number Theoretic Transform (NTT) and Modular Arithmetic for Fast Squaring of Very Large Numbers?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template