diff --git a/crypto/dap_crypto_common.h b/crypto/dap_crypto_common.h
index 92bf8e665937ffb3c1d7886641c9dbc830e9f7eb..ea57bf763d9d2efd284a209f0456c2ef4fc6b990 100644
--- a/crypto/dap_crypto_common.h
+++ b/crypto/dap_crypto_common.h
@@ -18,11 +18,14 @@ extern "C" {
 
 #define OS_WIN       1
 #define OS_LINUX     2
+#define OS_MACOS     3
 
 #if defined(_WIN32)        // Microsoft Windows OS
     #define OS_TARGET OS_WIN
 #elif defined(__linux__)        // Linux OS
     #define OS_TARGET OS_LINUX
+#elif defined(__APPLE__)         // MACOS
+    #define OS_TARGET OS_MACOS
 #else
     #error -- "Unsupported OS"
 #endif
diff --git a/crypto/msrln/kex.c b/crypto/msrln/kex.c
index c532997467ac472dc61814b92186ebe7689b4323..8b2eafbc171ace77882212d1becb7923f8dd9eeb 100644
--- a/crypto/msrln/kex.c
+++ b/crypto/msrln/kex.c
@@ -1,5 +1,10 @@
 #include "msrln_priv.h"
-#include <malloc.h>
+#if (OS_TARGET == OS_MACOS)
+    #include <stdio.h>
+#else
+    #include <malloc.h>
+#endif
+
 
 //extern const int32_t MSRLN_psi_rev_ntt1024_12289[1024];
 //extern const int32_t MSRLN_omegainv_rev_ntt1024_12289[1024];