crypto/ringlwe/FFT/FFT_256_15361.c
/*
We use Gentleman-Sande, decimation-in-frequency FFT, for the forward FFT.
Note that we will not perform the usual scambling / bit-reversal procedure here because we will invert 
the fourier transform using decimation-in-time.
*/
We use Gentleman-Sande, decimation-in-frequency FFT, for the forward FFT.
Note that we will not perform the usual scambling / bit-reversal procedure here because we will invert
the fourier transform using decimation-in-time.
We use Gentleman - Sande decimation - in - frequency FFT for the forward FFT . Note that we will not perform the usual scambling / bit - reversal procedure here because we will invert the fourier transform using decimation - in - time .
void FFT_forward_256_15361(FFTSHORT x[256]) {
        const FFTSHORT n = 256;
	const FFTSHORT q = 15361;
	FFTSHORT index, step;
	FFTSHORT i,j,m;
	FFTSHORT t0,t1;
	step = 1;
	for (m = n>>1; m >= 1; m=m>>1) {
		index = 0;
		for (j = 0 ; j < m; ++j) {
			for (i = j; i < n; i += (m<<1)) {
				ADD_MOD(t0, x[i], x[i+m], q);
				ADD(t1, x[i], q - x[i+m]);
				MUL_MOD(x[i+m], t1, W_256_15361[index], q);				
				x[i] = t0;				
			}
			SUB_MODn(index, index, step, n);
		}
		step = step << 1;
	}	 
}
void FFT_forward_256_15361 ( FFTSHORT x [ 256 ] ) { const FFTSHORT n = 256 ; const FFTSHORT q = 15361 ; FFTSHORT index , step ; FFTSHORT i , j , m ; FFTSHORT t0 , t1 ; step = 1 ; for ( m = n >> 1 ; m >= 1 ; m = m >> 1 ) { index = 0 ; for ( j = 0 ; j < m ; ++ j ) { for ( i = j ; i < n ; i += ( m << 1 ) ) { ADD_MOD ( t0 , x [ i ] , x [ i + m ] , q ) ; ADD ( t1 , x [ i ] , q - x [ i + m ] ) ; MUL_MOD ( x [ i + m ] , t1 , W_256_15361 [ index ] , q ) ; x [ i ] = t0 ; } SUB_MODn ( index , index , step , n ) ; } step = step << 1 ; } }
We use Gentleman-Sande, decimation-in-frequency FFT, for the forward FFT.
We use Gentleman - Sande decimation - in - frequency FFT for the forward FFT .