From e72e2de1c5631d1c68f9795b967f764ceb9b24e7 Mon Sep 17 00:00:00 2001
From: "Dmitriy A. Gerasimov" <kahovski@gmail.com>
Date: Tue, 11 Dec 2018 14:21:39 +0700
Subject: [PATCH] [*] Protocol version rised (#33)

---
 CMakeLists.txt    |  4 ++++
 core/dap_common.h |  2 +-
 crypto/dap_enc.h  | 14 +++++++++-----
 3 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index fb42c1f..2008276 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,3 +13,7 @@ endif()
 
 add_subdirectory(core)
 add_subdirectory(crypto)
+
+if(UNIX AND NOT APPLE)
+        set(LINUX TRUE)
+endif()
diff --git a/core/dap_common.h b/core/dap_common.h
index e6ae028..1ee228c 100644
--- a/core/dap_common.h
+++ b/core/dap_common.h
@@ -35,7 +35,7 @@
 #define DAP_DELETE(a)   free(a)
 #define DAP_DUP(a) (__typeof(a) ret = memcpy(ret,a,sizeof(*a)) )
 
-#define DAP_PROTOCOL_VERSION 21
+#define DAP_PROTOCOL_VERSION 22
 
 #if defined(__GNUC__) ||defined (__clang__)
 #define DAP_ALIGN_PACKED  __attribute__((aligned(1),packed))
diff --git a/crypto/dap_enc.h b/crypto/dap_enc.h
index 2e99633..c0ea8a7 100644
--- a/crypto/dap_enc.h
+++ b/crypto/dap_enc.h
@@ -36,11 +36,15 @@ void dap_enc_deinit(void);
 size_t dap_enc_code_out_size(dap_enc_key_t* a_key, const size_t a_buf_in_size, dap_enc_data_type_t type);
 size_t dap_enc_decode_out_size(dap_enc_key_t* a_key, const size_t a_buf_in_size, dap_enc_data_type_t type);
 
-size_t dap_enc_code(struct dap_enc_key * a_key, const void * a_buf_in, const size_t a_buf_in_size, void * a_buf_out, const size_t a_buf_out_size_max,
-                    dap_enc_data_type_t a_data_type_out);
-
-size_t dap_enc_decode(struct dap_enc_key * a_key, const void * a_buf_in, const size_t a_buf_in_size, void * a_buf_out, const size_t a_buf_out_size_max,
-                     dap_enc_data_type_t a_data_type_in);
+size_t dap_enc_code(struct dap_enc_key * a_key, // Key
+                    const void * a_buf_in, const size_t a_buf_in_size, // Input
+                    void * a_buf_out, const size_t a_buf_out_size_max, // Output
+                    dap_enc_data_type_t a_data_type_out); // Output data type
+
+size_t dap_enc_decode(struct dap_enc_key * a_key, // Key
+                      const void * a_buf_in, const size_t a_buf_in_size, // Input
+                      void * a_buf_out, const size_t a_buf_out_size_max, // Output
+                     dap_enc_data_type_t a_data_type_in); // Output data type
 
 #ifdef __cplusplus
 }
-- 
GitLab