diff --git a/src/crandom.c b/src/crandom.c index 83999c9..4808d3e 100644 --- a/src/crandom.c +++ b/src/crandom.c @@ -27,10 +27,10 @@ unsigned int crandom_detect_features(void) { if (c & 1<<25) out |= AESNI; if (c & 1<<28) out |= AVX; if (b & 1<<5) out |= AVX2; + if (c & 1<<30) out |= RDRAND; a=0x80000001; __asm__("cpuid" : "+a"(a), "=b"(b), "=c"(c), "=d"(d)); if (c & 1<<11) out |= XOP; - if (c & 1<<30) out |= RDRAND; # endif return out; diff --git a/src/shake.c b/src/shake.c index 6718b0a..a5051d3 100644 --- a/src/shake.c +++ b/src/shake.c @@ -272,7 +272,7 @@ static void get_cpu_entropy(uint8_t *entropy, size_t len) { static char tested = 0, have_rdrand = 0; if (!tested) { u_int32_t a,b,c,d; - a=0x80000001; __asm__("cpuid" : "+a"(a), "=b"(b), "=c"(c), "=d"(d)); + a=1; __asm__("cpuid" : "+a"(a), "=b"(b), "=c"(c), "=d"(d)); have_rdrand = (c>>30)&1; tested = 1; }