53#if !defined(MBEDTLS_CONFIG_FILE)
56#include MBEDTLS_CONFIG_FILE
59#if defined(MBEDTLS_PADLOCK_C)
69#if defined(MBEDTLS_HAVE_X86)
74int mbedtls_padlock_has_support(
int feature )
76 static int flags = -1;
81 asm(
"movl %%ebx, %0 \n\t"
82 "movl $0xC0000000, %%eax \n\t"
84 "cmpl $0xC0000001, %%eax \n\t"
87 "movl $0xC0000001, %%eax \n\t"
94 :
"eax",
"ecx",
"edx" );
107 const unsigned char input[16],
108 unsigned char output[16] )
114 unsigned char buf[256];
117 blk = MBEDTLS_PADLOCK_ALIGN16(
buf );
125 "movl %%ebx, %0 \n\t"
126 "movl $1, %%ecx \n\t"
127 "movl %2, %%edx \n\t"
128 "movl %3, %%ebx \n\t"
129 "movl %4, %%esi \n\t"
130 "movl %4, %%edi \n\t"
131 ".byte 0xf3,0x0f,0xa7,0xc8 \n\t"
132 "movl %1, %%ebx \n\t"
135 :
"memory",
"ecx",
"edx",
"esi",
"edi" );
148 unsigned char iv[16],
149 const unsigned char *
input,
150 unsigned char *output )
157 unsigned char buf[256];
159 if( ( (
long)
input & 15 ) != 0 ||
160 ( (
long) output & 15 ) != 0 )
164 iw = MBEDTLS_PADLOCK_ALIGN16(
buf );
168 *
ctrl = 0x80 |
ctx->nr | ( (
ctx->nr + (
mode ^ 1 ) - 10 ) << 9 );
174 "movl %%ebx, %0 \n\t"
175 "movl %2, %%ecx \n\t"
176 "movl %3, %%edx \n\t"
177 "movl %4, %%ebx \n\t"
178 "movl %5, %%esi \n\t"
179 "movl %6, %%edi \n\t"
180 "movl %7, %%eax \n\t"
181 ".byte 0xf3,0x0f,0xa7,0xd0 \n\t"
182 "movl %1, %%ebx \n\t"
185 "m" (rk),
"m" (
input),
"m" (output),
"m" (iw)
186 :
"memory",
"eax",
"ecx",
"edx",
"esi",
"edi" );
GLuint GLuint GLsizei count
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLsizei GLsizei * length
GLenum GLenum GLenum input
#define memcpy(s1, s2, n)
INTERNETFEATURELIST feature
VIA PadLock ACE for HW encryption/decryption supported by some processors.
#define MBEDTLS_ERR_PADLOCK_DATA_MISALIGNED
Configuration options (set of defines)
The AES context-type definition.
ecx edi movl ebx edx edi decl ecx esi eax jecxz decl eax andl ebx
ecx edi movl ebx edx edi decl ecx esi eax jecxz decl eax andl eax esi movl edx