summaryrefslogtreecommitdiff
path: root/code/crypto/include/compat.h
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2017-05-03 21:10:08 +0200
committerUros Majstorovic <majstor@majstor.org>2017-05-03 21:10:08 +0200
commit25de5e761daab8b897a4f09ff8503e6f43c299f9 (patch)
treea9a1c185c7f89d67f9250e42b2aa53eefc9a6770 /code/crypto/include/compat.h
initial commit
Diffstat (limited to 'code/crypto/include/compat.h')
-rw-r--r--code/crypto/include/compat.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/code/crypto/include/compat.h b/code/crypto/include/compat.h
new file mode 100644
index 0000000..12fb3f4
--- /dev/null
+++ b/code/crypto/include/compat.h
@@ -0,0 +1,24 @@
+#include <sys/types.h>
+#include <stdint.h>
+
+#ifndef HAVE_GETENTROPY
+int getentropy(void *buf, size_t buflen);
+#endif
+
+#ifndef HAVE_EXPLICIT_BZERO
+void explicit_bzero(void *, size_t);
+#endif
+
+#ifndef HAVE_TIMINGSAFE_BCMP
+int timingsafe_bcmp(const void *b1, const void *b2, size_t n);
+#endif
+
+#ifndef HAVE_TIMINGSAFE_MEMCMP
+int timingsafe_memcmp(const void *b1, const void *b2, size_t len);
+#endif
+
+#ifndef HAVE_ARC4RANDOM_BUF
+uint32_t arc4random(void);
+void arc4random_buf(void *_buf, size_t n);
+uint32_t arc4random_uniform(uint32_t upper_bound);
+#endif