*/
#include <stdio.h>
-#include <sys/types.h>
#include <time.h>
-#include "rand.h"
+#include <openssl/rand.h>
#ifdef NO_RAND
static RAND_METHOD *rand_meth=NULL;
rand_meth->seed(buf,num);
}
-void RAND_bytes(unsigned char *buf, int num)
+void RAND_add(const void *buf, int num, double entropy)
{
if (rand_meth != NULL)
- rand_meth->bytes(buf,num);
+ rand_meth->add(buf,num,entropy);
}
+int RAND_bytes(unsigned char *buf, int num)
+ {
+ if (rand_meth != NULL)
+ return rand_meth->bytes(buf,num);
+ return(-1);
+ }
+
+int RAND_pseudo_bytes(unsigned char *buf, int num)
+ {
+ if (rand_meth != NULL)
+ return rand_meth->pseudorand(buf,num);
+ return(-1);
+ }
+
+int RAND_status(void)
+ {
+ if (rand_meth != NULL)
+ return rand_meth->status();
+ return 0;
+ }