Update rand_bytes()

This commit is contained in:
Zhi Guan
2022-12-22 17:08:50 +08:00
parent 950ef49fb6
commit 9ce7a54649
6 changed files with 60 additions and 76 deletions

View File

@@ -14,7 +14,9 @@
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h> // in Linux
//#include <sys/random.h> // in Apple
#ifdef APPLE
#include <sys/random.h> // in Apple
#endif
#include <gmssl/rand.h>
#include <gmssl/error.h>
@@ -37,4 +39,3 @@ int rand_bytes(uint8_t *buf, size_t len)
}
return 1;
}