crypto/ringlwe/ringlwe_kex.c
/* Decapsulation routine.
 * input:  Bob's public key u in Fourier Domain
 *         Alice's private key s_1 in Fourier Domain
 *         reconciliation data cr_v
 * output: shared secret mu
 */
Decapsulation routine.
input:  Bob's public key u in Fourier Domain
Alice's private key s_1 in Fourier Domain
reconciliation data cr_v
output: shared secret mu
Decapsulation routine . input : Bob ' s public key u in Fourier Domain Alice ' s private key s_1 in Fourier Domain reconciliation data cr_v output : shared secret mu
void KEM1_Decapsulate(uint64_t *mu,  
			const RINGELT *u,    
			const RINGELT *s_1,  
			const uint64_t *cr_v, 
			const RINGLWE_PARAM_DATA *p) {
  RINGELT w[p->m];
  POINTWISE_MUL(w, s_1, u, p->m, p->q); 
  assert(p->fft_backward);
  p->fft_backward((FFTSHORT *)w); 
  if ((p->m)&1)  
    MAPTOCYCLOTOMIC(w, p->m, p->q);
  ringlwe_rec(mu, w, cr_v, p);
  memset(w, 0, p->m * sizeof(RINGELT));
}
void KEM1_Decapsulate ( uint64_t * mu , const RINGELT * u , const RINGELT * s_1 , const uint64_t * cr_v , const RINGLWE_PARAM_DATA * p ) { RINGELT w [ p -> m ] ; POINTWISE_MUL ( w , s_1 , u , p -> m , p -> q ) ; assert ( p -> fft_backward ) ; p -> fft_backward ( ( FFTSHORT * ) w ) ; if ( ( p -> m ) & 1 ) MAPTOCYCLOTOMIC ( w , p -> m , p -> q ) ; ringlwe_rec ( mu , w , cr_v , p ) ; memset ( w , 0 , p -> m * sizeof ( RINGELT ) ) ; }
Decapsulation routine.
Decapsulation routine .
/*[muwords]*/ /*[m]*/ /*[m]*/ /*[muwords]*/ /* Create w = s1*u */ /* Undo the Fourier Transform */ /* prime case */