- Added mpi_fill_random() for centralized filling of big numbers with random data (Fixed ticket #10)

This commit is contained in:
Paul Bakker 2011-03-26 13:18:49 +00:00
parent 98675496e1
commit 287781a965
4 changed files with 35 additions and 23 deletions

View file

@ -466,6 +466,19 @@ int mpi_mod_int( t_int *r, const mpi *A, int b );
*/
int mpi_exp_mod( mpi *X, const mpi *A, const mpi *E, const mpi *N, mpi *_RR );
/**
* \brief Fill an MPI X with size bytes of random
*
* \param X Destination MPI
* \param size Size in bytes
* \param f_rng RNG function
* \param p_rng RNG parameter
*
* \return 0 if successful,
* 1 if memory allocation failed
*/
int mpi_fill_random( mpi *X, int size, int (*f_rng)(void *), void *p_rng );
/**
* \brief Greatest common divisor: G = gcd(A, B)
*