CiFEr
Functions
normal_cdt.h File Reference

Normal sampler that samples from small fixed half-Gaussian distribution. More...

Go to the source code of this file.

Functions

void cfe_normal_cdt_sample (mpz_t res)
 

Detailed Description

Normal sampler that samples from small fixed half-Gaussian distribution.

Function Documentation

◆ cfe_normal_cdt_sample()

void cfe_normal_cdt_sample ( mpz_t  res)

cfe_normal_cdt_sample samples random values from the discrete Normal (Gaussian) probability distribution, limited to non-negative values (half-Gaussian). In particular each value x from Z^+ is sampled with probability proportional to exp(-x^2/sigma^2) where sigma = sqrt(1/(2ln(2))). The implementation is based on paper: "FACCT: FAst, Compact, and Constant-Time Discrete Gaussian Sampler over Integers" by R. K. Zhao, R. Steinfeld, and A. Sakzad (https://eprint.iacr.org/2018/1234.pdf). See the above paper where it is argued that such a sampling achieves a relative error at most 2^{-46} with the chosen parameters.

Parameters
resThe result of sampling will be saved here