GNU General Public License for more details.
*/
+/* $Id$ */
/*
* Created: Sun Mar 9 00:09:18 1997
*
*/
/* XXX: Some operations block resulting slow initialization.
* XXX: I have some pending changes to make this better. */
-/*
- * $Id$
- * $Log$
- * Revision 1.2 2000/07/05 06:08:43 priikone
- * Global cosmetic change.
- *
- * Revision 1.1.1.1 2000/06/27 11:36:55 priikone
- * Imported from internal CVS/Added Log headers.
- *
- *
- */
#include "silcincludes.h"
(i * (sizeof(rng->pool) / SILC_RNG_STATE_NUM));
next->pos =
(i * (sizeof(rng->pool) / SILC_RNG_STATE_NUM)) + 8;
-#if 0
- next->pos = sizeof(rng->pool) -
- ((i * (sizeof(rng->pool) / SILC_RNG_STATE_NUM))) + 8;
-#endif
next->next = rng->state;
rng->state = next;
}
return string;
}
+
+/* Returns random number binary data. */
+
+unsigned char *silc_rng_get_rn_data(SilcRng rng, unsigned int len)
+{
+ int i;
+ unsigned char *data;
+
+ data = silc_calloc(len + 1, sizeof(*data));
+
+ for (i = 0; i < len; i++)
+ data[i] = silc_rng_get_byte(rng);
+
+ return data;
+}