lopy4/components/Bliss-master/sampler.c
/*
 * Initialize sampler:
 * - return true if success/false if error
 * - false means that the parameters sigma/ell/precisions are not supported
 */
Initialize sampler:
- return true if success/false if error
- false means that the parameters sigma/ell/precisions are not supported
Initialize sampler : - return true if success / false if error - false means that the parameters sigma / ell / precisions are not supported
bool sampler_init(sampler_t *sampler, uint32_t sigma, uint32_t ell, uint32_t precision, entropy_t *entropy) {
  sampler->entropy = entropy;
  sampler->sigma = sigma;
  sampler->ell = ell;
  sampler->precision = precision;
  sampler->columns = sampler->precision / 8;
  sampler->c = get_table(sigma, ell, precision);
  if (sampler->c != NULL) {
    sampler->k_sigma = get_k_sigma(sigma, precision);
    sampler->k_sigma_bits = get_k_sigma_bits(sigma, precision);
    return true;
  }
  return false;
}
bool sampler_init ( sampler_t * sampler , uint32_t sigma , uint32_t ell , uint32_t precision , entropy_t * entropy ) { sampler -> entropy = entropy ; sampler -> sigma = sigma ; sampler -> ell = ell ; sampler -> precision = precision ; sampler -> columns = sampler -> precision / 8 ; sampler -> c = get_table ( sigma , ell , precision ) ; if ( sampler -> c != NULL ) { sampler -> k_sigma = get_k_sigma ( sigma , precision ) ; sampler -> k_sigma_bits = get_k_sigma_bits ( sigma , precision ) ; return true ; } return false ; }
Initialize sampler:
 - return true if success/false if error
 - false means that the parameters sigma/ell/precisions are not supported
Initialize sampler : - return true if success / false if error - false means that the parameters sigma / ell / precisions are not supported