RAND: changed read_int_dev_urandom() to get_int_dev_urandom()
This commit is contained in:
parent
2f9ebd52f8
commit
8db6a83ae3
@ -37,7 +37,7 @@
|
|||||||
* static declarations
|
* static declarations
|
||||||
*/
|
*/
|
||||||
static mp_digit get_int_dev_random(void);
|
static mp_digit get_int_dev_random(void);
|
||||||
static mp_digit read_int_dev_urandom(void);
|
static mp_digit get_int_dev_urandom(void);
|
||||||
static mp_digit get_random_ternary(mp_digit random_int, int* sign);
|
static mp_digit get_random_ternary(mp_digit random_int, int* sign);
|
||||||
static mp_int *get_random_bigint(mp_int *upper_bound, mp_int *lower_bound,
|
static mp_int *get_random_bigint(mp_int *upper_bound, mp_int *lower_bound,
|
||||||
int entropy_source);
|
int entropy_source);
|
||||||
@ -73,7 +73,7 @@ static mp_digit get_int_dev_random(void)
|
|||||||
*
|
*
|
||||||
* @return the randomly chosen integer
|
* @return the randomly chosen integer
|
||||||
*/
|
*/
|
||||||
static mp_digit read_int_dev_urandom(void)
|
static mp_digit get_int_dev_urandom(void)
|
||||||
{
|
{
|
||||||
int random_data;
|
int random_data;
|
||||||
mp_digit random_int;
|
mp_digit random_int;
|
||||||
@ -171,7 +171,7 @@ pb_poly *ntru_get_random_poly_ternary(size_t length, int entropy_source)
|
|||||||
if (entropy_source == GET_INT_FROM_RRAND) {
|
if (entropy_source == GET_INT_FROM_RRAND) {
|
||||||
coefficient = get_int_dev_random();
|
coefficient = get_int_dev_random();
|
||||||
} else if (entropy_source == GET_INT_FROM_URAND) {
|
} else if (entropy_source == GET_INT_FROM_URAND) {
|
||||||
coefficient = read_int_dev_urandom();
|
coefficient = get_int_dev_urandom();
|
||||||
} else {
|
} else {
|
||||||
NTRU_ABORT("No suitable entropy source selectetd.\n");
|
NTRU_ABORT("No suitable entropy source selectetd.\n");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user