post quantum cryptography
Highly optimized implementation of the NTRUEncrypt algorithm
|
public API, random polynomials More...
Go to the source code of this file.
Functions | |
int | get_rnd_int (void) |
int | get_urnd_int (void) |
void | ntru_get_rnd_tern_poly_num (fmpz_poly_t poly, const ntru_params *params, uint32_t num_ones, uint32_t num_neg_ones, int(*rnd_int)(void)) |
public API, random polynomials
This file holds the public API of generating random ternary polynomials of the pqc NTRU implementation and is meant to be installed on the client system.
Definition in file rnd.h.
int get_rnd_int | ( | void | ) |
Get a random integer from /dev/random.
int get_urnd_int | ( | void | ) |
Get a pseudo random integer from /dev/urandom.
void ntru_get_rnd_tern_poly_num | ( | fmpz_poly_t | poly, |
const ntru_params * | params, | ||
uint32_t | num_ones, | ||
uint32_t | num_neg_ones, | ||
int(*)(void) | rnd_int | ||
) |
Get a random ternary polynomial with specified numbers of 1 coefficients and -1 coefficients.
poly | the resulting random polynomial [out] |
params | the NTRU context |
num_ones | the number of 1 coefficients |
num_neg_ones | the number of -1 coefficients |
rnd_int | function callback which should return a random integer |