This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
silc_rng_xor(rng, getpgid(getpid()) << 8, 2);
silc_rng_xor(rng, getpgid(getpid()) << 8, 3);
#endif
silc_rng_xor(rng, getpgid(getpid()) << 8, 2);
silc_rng_xor(rng, getpgid(getpid()) << 8, 3);
#endif
#ifdef HAVE_GETPGRP
silc_rng_xor(rng, getpgrp(), 5);
#endif
#ifdef HAVE_GETSID
silc_rng_xor(rng, getsid(getpid()) << 16, 6);
#endif
#ifdef HAVE_GETPGRP
silc_rng_xor(rng, getpgrp(), 5);
#endif
#ifdef HAVE_GETSID
silc_rng_xor(rng, getsid(getpid()) << 16, 6);
#endif
silc_rng_xor(rng, times(&ptime), 7);
silc_rng_xor(rng, ptime.tms_utime, 8);
silc_rng_xor(rng, (ptime.tms_utime + ptime.tms_stime), pos++);
silc_rng_xor(rng, times(&ptime), 7);
silc_rng_xor(rng, ptime.tms_utime, 8);
silc_rng_xor(rng, (ptime.tms_utime + ptime.tms_stime), pos++);
silc_rng_xor(rng, (ptime.tms_stime ^ ptime.tms_cutime), pos++);
silc_rng_xor(rng, (ptime.tms_cutime + ptime.tms_stime), pos++);
silc_rng_xor(rng, (ptime.tms_stime << 8), pos++);
silc_rng_xor(rng, (ptime.tms_stime ^ ptime.tms_cutime), pos++);
silc_rng_xor(rng, (ptime.tms_cutime + ptime.tms_stime), pos++);
silc_rng_xor(rng, (ptime.tms_stime << 8), pos++);
silc_rng_xor(rng, times(&ptime), pos++);
silc_rng_xor(rng, ptime.tms_utime, pos++);
silc_rng_xor(rng, times(&ptime), pos++);
silc_rng_xor(rng, ptime.tms_utime, pos++);
silc_rng_xor(rng, (r.ru_utime.tv_sec ^ r.ru_utime.tv_usec), pos++);
silc_rng_xor(rng, (r.ru_stime.tv_sec + r.ru_stime.tv_usec), pos++);
silc_rng_xor(rng, (r.ru_stime.tv_sec ^ r.ru_stime.tv_usec), pos++);
silc_rng_xor(rng, (r.ru_utime.tv_sec ^ r.ru_utime.tv_usec), pos++);
silc_rng_xor(rng, (r.ru_stime.tv_sec + r.ru_stime.tv_usec), pos++);
silc_rng_xor(rng, (r.ru_stime.tv_sec ^ r.ru_stime.tv_usec), pos++);
silc_rng_xor(rng, (r.ru_maxrss + r.ru_ixrss), pos++);
silc_rng_xor(rng, (r.ru_maxrss ^ r.ru_ixrss), pos++);
silc_rng_xor(rng, (r.ru_idrss + r.ru_idrss), pos++);
silc_rng_xor(rng, (r.ru_maxrss + r.ru_ixrss), pos++);
silc_rng_xor(rng, (r.ru_maxrss ^ r.ru_ixrss), pos++);
silc_rng_xor(rng, (r.ru_idrss + r.ru_idrss), pos++);
silc_rng_xor(rng, (r.ru_nsignals << 16), pos++);
silc_rng_xor(rng, (r.ru_nvcsw + r.ru_nivcsw), pos++);
silc_rng_xor(rng, (r.ru_nvcsw ^ r.ru_nivcsw), pos++);
silc_rng_xor(rng, (r.ru_nsignals << 16), pos++);
silc_rng_xor(rng, (r.ru_nvcsw + r.ru_nivcsw), pos++);
silc_rng_xor(rng, (r.ru_nvcsw ^ r.ru_nivcsw), pos++);
/* Initialize global RNG. If `rng' is provided it is set as the global
RNG object (it can be allocated by the application for example). */
/* Initialize global RNG. If `rng' is provided it is set as the global
RNG object (it can be allocated by the application for example). */
-unsigned char *silc_rng_global_get_rn_data(SilcUInt32 len)
+SilcBool silc_rng_global_get_rn_data(SilcRng rng, SilcUInt32 len,
+ unsigned char *buf, SilcUInt32 buf_size)