Implementation of Multidigit Multiplication Basing on Discrete Cosine and Sine Transforms

Introduction. The emergence of new parallel computing systems such as multi-core processors, clusters, distributed systems, due to the solution of various applications in different spheres. Among such problems are the calculation of systems of linear algebraic equations with the number of unknown 33-35 million, the calculation of nuclear reactor shells, modeling of physical and chemical processes, aerodynamics, hydrodynamics, information security, and so on. This greatly expands the use of multidigit arithmetic, due to the fact that ignoring rounding errors leads to the fact that sometimes computer solutions are obtained that do not correspond to the physical content. Multidigit multiplication operation is an integral part of the exponentiation by module operation, the speed of which determines the speed of asymmetric cryptographic software and hardware complexes. This paper presents algorithms for implementing the multiplication operation of two N-digit numbers based on discrete cosine and sine transforms (DCT and DST) by separating the calculation for the real and imaginary parts of the DFT. Calculation of DCT and DST at the expense of additional bit shifts, additions and subtractions reduces the algorithm complexity to linear complexity by the number of integer multiplication operations. The purpose of the article is to reduce the number of multiplication operations to speed up the execution time of the multiplication operation of two N-bit numbers based on discrete transforms. Reduce the number of complex multiplication operations. Reduce the overall computational complexity and find a modification in which the calculation steps will correspond to DCT, DSP, IDCT and IDST. Use the coefficients to take into account the rounding errors to exclude multiplication operations on calculating DCT, DST, IDCT and IDST. Results. The relationship between DCT, DST and DFT of a real signal is considered, which allows to separate calculations for real and imaginary parts of DFT of real signals. The computational complexity is reduced almost twice at the expense of use of DFT properties of real signals. It is shown that after optimization steps of the algorithm calculation correspond to DCT, DST, IDCT and IDST. Using additional coefficients, which allow to take into account rounding errors at each step so that all calculations use integers. An analysis of the choice of word length in the calculation is given. For each algorithm, examples of calculation are given. Tables of dependence of the minimum lengths of the coefficients on the length of the multidigit number and the length of the digit (in bits) are given. Conclusions. Multiplication algorithms of two N-digit numbers based on discrete cosine and sine transforms (DCT and DST) are presented in this paper. Separating the calculation for the real and imaginary parts of the DFT allows to reduce the number of multiplication operations by 33%. The use of additional coefficients and calculation of DCT, DST, IDCT, IDST at the expense of bit shifts, additions and subtractions reduces the complexity of the multiplication algorithm of two N-digit numbers to linear complexity by the number of simple integer multiplication operations. Based on comparative analysis, it is shown that the proposed method of multiplication based on DCT and DST using integers begins to exceed the Karatsuba method by the number of 32-bit multiplication operations when multiplying numbers, starting with a length of 4096 bits. Keywords: multidigit multiplication, multidigit arithmetic, asymmetric cryptography, discrete cosine transform, discrete sine transform, discrete Fourier transform, fast algorithm for Fourier calculation.