mirror of
https://github.com/termux-pacman/termux-packages.git
synced 2026-02-05 09:32:36 +00:00
15 lines
365 B
Diff
15 lines
365 B
Diff
--- a/src/crypto/random.c
|
|
+++ b/src/crypto/random.c
|
|
@@ -21,6 +21,11 @@
|
|
// TODO: This is linux specific
|
|
#include <sys/random.h>
|
|
|
|
+#if defined(__ANDROID__) && __ANDROID_API__ < 28
|
|
+#include <syscall.h>
|
|
+#define getrandom(buf,buflen,flags) syscall(SYS_getrandom,buf,buflen,flags)
|
|
+#endif
|
|
+
|
|
void crypto_random(uint8_t* dst, size_t len)
|
|
{
|
|
getrandom(dst, len, 0);
|