RND: make random int functions public
This commit is contained in:
parent
9b71469b51
commit
e88dc81c90
@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
/*------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
static int
|
int
|
||||||
get_rnd_int(void)
|
get_rnd_int(void)
|
||||||
{
|
{
|
||||||
int rnd_data = open("/dev/random", O_RDONLY);
|
int rnd_data = open("/dev/random", O_RDONLY);
|
||||||
@ -62,7 +62,7 @@ get_rnd_int(void)
|
|||||||
|
|
||||||
/*------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
static int
|
int
|
||||||
get_urnd_int(void)
|
get_urnd_int(void)
|
||||||
{
|
{
|
||||||
int rnd_data = open("/dev/urandom", O_RDONLY);
|
int rnd_data = open("/dev/urandom", O_RDONLY);
|
||||||
|
16
src/rnd.h
16
src/rnd.h
@ -35,6 +35,22 @@
|
|||||||
#include <fmpz_poly.h>
|
#include <fmpz_poly.h>
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a random integer from /dev/random.
|
||||||
|
*
|
||||||
|
* @return random integer
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
get_rnd_int(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a pseudo random integer from /dev/urandom.
|
||||||
|
*
|
||||||
|
* @return pseudo-random integer.
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
get_urnd_int(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a random ternary polynomial with specified numbers
|
* Get a random ternary polynomial with specified numbers
|
||||||
* of 1 coefficients and -1 coefficients.
|
* of 1 coefficients and -1 coefficients.
|
||||||
|
Loading…
Reference in New Issue
Block a user