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