diff --git a/src-cryptopp/cpu.cpp b/src-cryptopp/cpu.cpp index 42831c1..6eb5367 100644 --- a/src-cryptopp/cpu.cpp +++ b/src-cryptopp/cpu.cpp @@ -211,6 +211,14 @@ static inline bool IsAMD(const word32 output[4]) (output[3] /*EDX*/ == 0x69746E65); } +static inline bool IsHygon(const word32 output[4]) +{ + // This is the "HygonGenuine" string. + return (output[1] /*EBX*/ == 0x6f677948) && + (output[2] /*ECX*/ == 0x656e6975) && + (output[3] /*EDX*/ == 0x6e65476e); +} + static inline bool IsVIA(const word32 output[4]) { // This is the "CentaurHauls" string. Some non-PadLock's can return "VIA VIA VIA " @@ -270,7 +278,7 @@ void DetectX86Features() g_hasRDSEED = !!(cpuid3[1] /*EBX*/ & RDSEED_FLAG); } } - else if (IsAMD(cpuid)) + else if (IsAMD(cpuid) || IsHygon(cpuid)) { static const unsigned int RDRAND_FLAG = (1 << 30);