aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--include/aesni/block.h9
-rw-r--r--include/aesni/buffer.h9
-rw-r--r--include/aesni/data.h9
-rw-r--r--include/aesni/raw.h9
-rw-r--r--utils/aes128ecb_decrypt_file.cpp3
-rw-r--r--utils/aes128ecb_encrypt_file.cpp3
6 files changed, 36 insertions, 6 deletions
diff --git a/include/aesni/block.h b/include/aesni/block.h
index ea11817..6de2632 100644
--- a/include/aesni/block.h
+++ b/include/aesni/block.h
@@ -11,6 +11,11 @@
#include "data.h"
#include "raw.h"
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
static __inline void __fastcall aes128_expand_key_schedule(
AesBlock128 key,
Aes128KeySchedule* key_schedule)
@@ -364,3 +369,7 @@ static __inline AesBlock128 __fastcall aes256ctr_decrypt_block(
init_vector = aes128_be2le(init_vector);
return _mm_xor_si128(cipher, raw_aes256_encrypt_block(init_vector, key_schedule));
}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/include/aesni/buffer.h b/include/aesni/buffer.h
index aa6f5f0..c0a3805 100644
--- a/include/aesni/buffer.h
+++ b/include/aesni/buffer.h
@@ -10,6 +10,11 @@
#include <stdio.h>
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
size_t aes128ecb_encrypt_buffer(
const unsigned char* src,
size_t src_size,
@@ -20,3 +25,7 @@ size_t aes128ecb_decrypt_buffer(
size_t src_size,
unsigned char* dest,
Aes128KeySchedule* inverted_schedule);
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/include/aesni/data.h b/include/aesni/data.h
index 73b7f6e..d104f9d 100644
--- a/include/aesni/data.h
+++ b/include/aesni/data.h
@@ -11,6 +11,11 @@
#include <emmintrin.h>
#include <tmmintrin.h>
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
typedef __m128i AesBlock128;
static __inline AesBlock128 load_aes_block128(const unsigned char* src)
@@ -151,3 +156,7 @@ int parse_aes_block256_le(AesBlock256*, const char*);
int parse_aes_block128_be(AesBlock128*, const char*);
int parse_aes_block192_be(AesBlock192*, const char*);
int parse_aes_block256_be(AesBlock256*, const char*);
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/include/aesni/raw.h b/include/aesni/raw.h
index 6ea0c8a..562ac0c 100644
--- a/include/aesni/raw.h
+++ b/include/aesni/raw.h
@@ -10,6 +10,11 @@
#include "data.h"
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
void __fastcall raw_aes128_expand_key_schedule(
AesBlock128 key,
Aes128KeySchedule* key_schedule);
@@ -53,3 +58,7 @@ AesBlock128 __fastcall raw_aes256_encrypt_block(
AesBlock128 __fastcall raw_aes256_decrypt_block(
AesBlock128 cipher,
Aes256KeySchedule* inverted_schedule);
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/utils/aes128ecb_decrypt_file.cpp b/utils/aes128ecb_decrypt_file.cpp
index a405882..788118b 100644
--- a/utils/aes128ecb_decrypt_file.cpp
+++ b/utils/aes128ecb_decrypt_file.cpp
@@ -6,10 +6,7 @@
* See LICENSE.txt for details.
*/
-extern "C"
-{
#include <aesni/all.h>
-}
#include <cstdio>
diff --git a/utils/aes128ecb_encrypt_file.cpp b/utils/aes128ecb_encrypt_file.cpp
index bcb5293..407dd44 100644
--- a/utils/aes128ecb_encrypt_file.cpp
+++ b/utils/aes128ecb_encrypt_file.cpp
@@ -6,10 +6,7 @@
* See LICENSE.txt for details.
*/
-extern "C"
-{
#include <aesni/all.h>
-}
#include <cstdio>