From 8fe36b417f012c9e07dbc04e81c1d815eea180af Mon Sep 17 00:00:00 2001 From: toddouska Date: Wed, 25 Apr 2012 15:17:25 -0700 Subject: [PATCH] add cpuid asm for Windows, aes-ni .s still needs work --- ctaocrypt/src/aes.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/ctaocrypt/src/aes.c b/ctaocrypt/src/aes.c index 48879a6e1..22c5e47b4 100644 --- a/ctaocrypt/src/aes.c +++ b/ctaocrypt/src/aes.c @@ -724,10 +724,25 @@ static const word32 Td[5][256] = { #ifdef CYASSL_AESNI -#define cpuid(func,ax,bx,cx,dx)\ +#ifndef _MSC_VER + + #define cpuid(func,ax,bx,cx,dx)\ __asm__ __volatile__ ("cpuid":\ "=a" (ax), "=b" (bx), "=c" (cx), "=d" (dx) : "a" (func)); +#else + + #define cpuid(func,ax,bx,cx,dx)\ + __asm mov eax, func \ + __asm cpuid \ + __asm mov ax, eax \ + __asm mov bx, ebx \ + __asm mov cx, ecx \ + __asm mov dx, edx + +#endif /* _MSC_VER */ + + static int Check_CPU_support_AES() { unsigned int a,b,c,d;