core/src/main/java/org/bouncycastle/pqc/crypto/qtesla/Polynomial.java
/**************************************************************************************************************
     * Description:	Forward Number Theoretic Transform for Heuristic qTESLA Security Category-1, Category-3
     *				(Option for Size and Speed) and Provably-Secure qTESLA Security Category-1
     *
     * @param        destination        Destination of Transformation
     * @param        source            Source of Transformation
     * @param        n                Polynomial Degree
     * @param        q                Modulus
     * @param        qInverse
     *
     * @return none
     **************************************************************************************************************/
Forward Number Theoretic Transform for Heuristic qTESLA Security Category-1, Category-3
(Option for Size and Speed) and Provably-Secure qTESLA Security Category-1



@return none
Forward Number Theoretic Transform for Heuristic qTESLA Security Category - 1 Category - 3 ( Option for Size and Speed ) and Provably - Secure qTESLA Security Category - 1 @return none
private static void numberTheoreticTransform(long destination[], long source[], int n, int q, long qInverse)
    {
        int jTwiddle = 0;
        int numberOfProblem = n >> 1;
        for (; numberOfProblem > 0; numberOfProblem >>= 1)
        {
            int j = 0;
            int jFirst;
            for (jFirst = 0; jFirst < n; jFirst = j + numberOfProblem)
            {
                int omega = (int)source[jTwiddle++];
                for (j = jFirst; j < jFirst + numberOfProblem; j++)
                {
                    int temporary = (int)montgomery(omega * destination[j + numberOfProblem], q, qInverse);
                    destination[j + numberOfProblem] = destination[j] + (q - temporary);
                    destination[j] = destination[j] + temporary;
                }
            }
        }
    }
private static void numberTheoreticTransform ( long destination [ ] , long source [ ] , int n , int q , long qInverse ) { int jTwiddle = 0 ; int numberOfProblem = n >> 1 ; for ( ; numberOfProblem > 0 ; numberOfProblem >>= 1 ) { int j = 0 ; int jFirst ; for ( jFirst = 0 ; jFirst < n ; jFirst = j + numberOfProblem ) { int omega = ( int ) source [ jTwiddle ++ ] ; for ( j = jFirst ; j < jFirst + numberOfProblem ; j ++ ) { int temporary = ( int ) montgomery ( omega * destination [ j + numberOfProblem ] , q , qInverse ) ; destination [ j + numberOfProblem ] = destination [ j ] + ( q - temporary ) ; destination [ j ] = destination [ j ] + temporary ; } } } }
Description:     Forward Number Theoretic Transform for Heuristic qTESLA Security Category-1, Category-3
                          (Option for Size and Speed) and Provably-Secure qTESLA Security Category-1
Description : Forward Number Theoretic Transform for Heuristic qTESLA Security Category - 1 Category - 3 ( Option for Size and Speed ) and Provably - Secure qTESLA Security Category - 1