aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcryptobox/poly1305
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-01-30 11:36:24 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-01-30 11:36:24 +0100
commit9800118df8fce5931589ee2597a0e11e1e70aa8f (patch)
treea501caa76aba37a40ac43a13c85507e04062b0e3 /src/libcryptobox/poly1305
parentff463c609bd364a8090d89a52c4878fa1aef93bd (diff)
downloadrspamd-9800118df8fce5931589ee2597a0e11e1e70aa8f.tar.gz
rspamd-9800118df8fce5931589ee2597a0e11e1e70aa8f.zip
Another workaround to avoid __int128 warning
Diffstat (limited to 'src/libcryptobox/poly1305')
-rw-r--r--src/libcryptobox/poly1305/poly1305_internal.h19
-rw-r--r--src/libcryptobox/poly1305/ref-64.c21
2 files changed, 20 insertions, 20 deletions
diff --git a/src/libcryptobox/poly1305/poly1305_internal.h b/src/libcryptobox/poly1305/poly1305_internal.h
new file mode 100644
index 000000000..21b7aa7d2
--- /dev/null
+++ b/src/libcryptobox/poly1305/poly1305_internal.h
@@ -0,0 +1,19 @@
+#if defined(_MSC_VER)
+ #include <intrin.h>
+
+ typedef struct uint128_t {
+ unsigned long long lo;
+ unsigned long long hi;
+ } uint128_t;
+
+ #define POLY1305_NOINLINE __declspec(noinline)
+#elif defined(__GNUC__)
+ #pragma GCC system_header
+ #if defined(__SIZEOF_INT128__)
+ typedef unsigned __int128 uint128_t;
+ #else
+ typedef unsigned uint128_t __attribute__((mode(TI)));
+ #endif
+
+ #define POLY1305_NOINLINE __attribute__((noinline))
+#endif
diff --git a/src/libcryptobox/poly1305/ref-64.c b/src/libcryptobox/poly1305/ref-64.c
index 01b8ff2c1..48d5fbcc6 100644
--- a/src/libcryptobox/poly1305/ref-64.c
+++ b/src/libcryptobox/poly1305/ref-64.c
@@ -6,30 +6,11 @@
#include "config.h"
#include "poly1305.h"
+#include "poly1305_internal.h"
enum {
POLY1305_BLOCK_SIZE = 16
};
-#if defined(_MSC_VER)
- #include <intrin.h>
-
- typedef struct uint128_t {
- unsigned long long lo;
- unsigned long long hi;
- } uint128_t;
-
- #define POLY1305_NOINLINE __declspec(noinline)
-#elif defined(__GNUC__)
- #pragma GCC system_header
- #if defined(__SIZEOF_INT128__)
- typedef unsigned __int128 uint128_t;
- #else
- typedef unsigned uint128_t __attribute__((mode(TI)));
- #endif
-
- #define POLY1305_NOINLINE __attribute__((noinline))
-#endif
-
typedef struct poly1305_state_ref_t {
uint64_t r[3];
uint64_t h[3];