core/src/main/java/org/bouncycastle/pqc/crypto/qtesla/Polynomial.java
/**************************************************************************************************************
     * Description:	Forward Number Theoretic Transform for Provably-Secure qTESLA Security Category-3
     *
     * @param        destination        Destination of Transformation
     * @param        source            Source of Transformation
     *
     * @return none
     **************************************************************************************************************/
Forward Number Theoretic Transform for Provably-Secure qTESLA Security Category-3
@param        destination        Destination of Transformation
@param        source            Source of Transformation

@return none
Forward Number Theoretic Transform for Provably - Secure qTESLA Security Category - 3 @param destination Destination of Transformation @param source Source of Transformation @return none
private static void numberTheoreticTransform(long destination[], long source[])
    {
        int jTwiddle = 0;
        int numberOfProblem = Parameter.N_III_P >> 1;
        for (; numberOfProblem > 0; numberOfProblem >>= 1)
        {
            int j = 0;
            int jFirst;
            for (jFirst = 0; jFirst < Parameter.N_III_P; jFirst = j + numberOfProblem)
            {
                int omega = (int)source[jTwiddle++];
                for (j = jFirst; j < jFirst + numberOfProblem; j++)
                {
                    int temporary = (int)barrettP(
                        montgomery(
                            omega * destination[j + numberOfProblem],
                            Parameter.Q_III_P,
                            Parameter.Q_INVERSE_III_P
                        ),
                        Parameter.Q_III_P,
                        Parameter.BARRETT_MULTIPLICATION_III_P,
                        Parameter.BARRETT_DIVISION_III_P
                    );
                    destination[j + numberOfProblem] = barrettP(
                        destination[j] + Parameter.Q_III_P * 2L - temporary,
                        Parameter.Q_III_P,
                        Parameter.BARRETT_MULTIPLICATION_III_P,
                        Parameter.BARRETT_DIVISION_III_P
                    );
                    destination[j] = barrettP(
                        destination[j] + temporary,
                        Parameter.Q_III_P,
                        Parameter.BARRETT_MULTIPLICATION_III_P,
                        Parameter.BARRETT_DIVISION_III_P
                    );
                }
            }
        }
    }
private static void numberTheoreticTransform ( long destination [ ] , long source [ ] ) { int jTwiddle = 0 ; int numberOfProblem = Parameter . N_III_P >> 1 ; for ( ; numberOfProblem > 0 ; numberOfProblem >>= 1 ) { int j = 0 ; int jFirst ; for ( jFirst = 0 ; jFirst < Parameter . N_III_P ; jFirst = j + numberOfProblem ) { int omega = ( int ) source [ jTwiddle ++ ] ; for ( j = jFirst ; j < jFirst + numberOfProblem ; j ++ ) { int temporary = ( int ) barrettP ( montgomery ( omega * destination [ j + numberOfProblem ] , Parameter . Q_III_P , Parameter . Q_INVERSE_III_P ) , Parameter . Q_III_P , Parameter . BARRETT_MULTIPLICATION_III_P , Parameter . BARRETT_DIVISION_III_P ) ; destination [ j + numberOfProblem ] = barrettP ( destination [ j ] + Parameter . Q_III_P * 2L - temporary , Parameter . Q_III_P , Parameter . BARRETT_MULTIPLICATION_III_P , Parameter . BARRETT_DIVISION_III_P ) ; destination [ j ] = barrettP ( destination [ j ] + temporary , Parameter . Q_III_P , Parameter . BARRETT_MULTIPLICATION_III_P , Parameter . BARRETT_DIVISION_III_P ) ; } } } }
Description:     Forward Number Theoretic Transform for Provably-Secure qTESLA Security Category-3
 @param        destination        Destination of Transformation
 @param        source            Source of Transformation
Description : Forward Number Theoretic Transform for Provably - Secure qTESLA Security Category - 3 @param destination Destination of Transformation @param source Source of Transformation