aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcryptobox/cryptobox.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-01-29 10:08:04 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-01-29 10:08:04 +0000
commit609caa681b8d0cf9e58cb2824323d5fe04af6934 (patch)
tree819d89bad734b3978168aac817a5e385e05516e7 /src/libcryptobox/cryptobox.h
parente273f67fdfd1cfeb4b1db7d6d8160b9b0c90df98 (diff)
downloadrspamd-609caa681b8d0cf9e58cb2824323d5fe04af6934.tar.gz
rspamd-609caa681b8d0cf9e58cb2824323d5fe04af6934.zip
Add detection for RDRAND support
Diffstat (limited to 'src/libcryptobox/cryptobox.h')
-rw-r--r--src/libcryptobox/cryptobox.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libcryptobox/cryptobox.h b/src/libcryptobox/cryptobox.h
index 5dd3b9d60..4a3d1e1f7 100644
--- a/src/libcryptobox/cryptobox.h
+++ b/src/libcryptobox/cryptobox.h
@@ -40,6 +40,14 @@ struct rspamd_cryptobox_segment {
#define rspamd_cryptobox_HASHKEYBYTES 64
#define rspamd_cryptobox_HASHSTATEBYTES 256
+#define CPUID_AVX2 0x1
+#define CPUID_AVX 0x2
+#define CPUID_SSE2 0x4
+#define CPUID_SSE3 0x8
+#define CPUID_SSSE3 0x10
+#define CPUID_SSE41 0x20
+#define CPUID_RDRAND 0x40
+
typedef guchar rspamd_pk_t[rspamd_cryptobox_MAX_PKBYTES];
typedef guchar rspamd_sk_t[rspamd_cryptobox_MAX_SKBYTES];
typedef guchar rspamd_sig_t[rspamd_cryptobox_MAX_MACBYTES];
@@ -54,6 +62,7 @@ struct rspamd_cryptobox_library_ctx {
const gchar *poly1305_impl;
const gchar *siphash_impl;
const gchar *blake2_impl;
+ unsigned long cpu_config;
};
/**