aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcryptobox/cryptobox.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-02-29 11:11:39 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-02-29 11:11:39 +0000
commit3ed4cae07ea2adfea3fe5eb4070dcf59f9e11f5d (patch)
treec2c54d5ae7e055fd942bb7cd30681433cedec5d8 /src/libcryptobox/cryptobox.c
parent0c9184dcbde07a7f9cf04835ce10b45891f4c628 (diff)
downloadrspamd-3ed4cae07ea2adfea3fe5eb4070dcf59f9e11f5d.tar.gz
rspamd-3ed4cae07ea2adfea3fe5eb4070dcf59f9e11f5d.zip
[Minor] Hide rdrand checks for non-x86 platforms
Diffstat (limited to 'src/libcryptobox/cryptobox.c')
-rw-r--r--src/libcryptobox/cryptobox.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/libcryptobox/cryptobox.c b/src/libcryptobox/cryptobox.c
index 1085906de..e5c311268 100644
--- a/src/libcryptobox/cryptobox.c
+++ b/src/libcryptobox/cryptobox.c
@@ -148,6 +148,14 @@ rspamd_cryptobox_test_instr (gint instr)
case CPUID_SSE2:
__asm__ volatile ("pmuludq %xmm0, %xmm0");
break;
+ case CPUID_RDRAND:
+ /* Use byte code here for compatibility */
+ __asm__ volatile (".byte 0x0f,0xc7,0xf0; setc %1"
+ : "=a" (rd), "=qm" (ok)
+ :
+ : "edx"
+ );
+ break;
#endif
#ifdef HAVE_SSE3
case CPUID_SSE3:
@@ -174,15 +182,8 @@ rspamd_cryptobox_test_instr (gint instr)
__asm__ volatile ("vpaddq %ymm0, %ymm0, %ymm0");\
break;
#endif
- case CPUID_RDRAND:
- /* Use byte code here for compatibility */
- __asm__ volatile (".byte 0x0f,0xc7,0xf0; setc %1"
- : "=a" (rd), "=qm" (ok)
- :
- : "edx"
- );
- break;
default:
+ return FALSE;
break;
}