mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
Update external polarssl to 1.3.8
There were some fixes back on March 13th, 2014 for fixing compiling on MIPS64. Also some fixes on June 25th, 2014 for SPARC64 fixes. Probably more things, but those are what I care about.
This commit is contained in:
76
Externals/polarssl/library/padlock.c
vendored
76
Externals/polarssl/library/padlock.c
vendored
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* VIA PadLock support functions
|
||||
*
|
||||
* Copyright (C) 2006-2010, Brainspark B.V.
|
||||
* Copyright (C) 2006-2014, Brainspark B.V.
|
||||
*
|
||||
* This file is part of PolarSSL (http://www.polarssl.org)
|
||||
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
|
||||
@ -29,7 +29,11 @@
|
||||
* programming_guide.pdf
|
||||
*/
|
||||
|
||||
#if !defined(POLARSSL_CONFIG_FILE)
|
||||
#include "polarssl/config.h"
|
||||
#else
|
||||
#include POLARSSL_CONFIG_FILE
|
||||
#endif
|
||||
|
||||
#if defined(POLARSSL_PADLOCK_C)
|
||||
|
||||
@ -47,17 +51,17 @@ int padlock_supports( int feature )
|
||||
|
||||
if( flags == -1 )
|
||||
{
|
||||
asm( "movl %%ebx, %0 \n" \
|
||||
"movl $0xC0000000, %%eax \n" \
|
||||
"cpuid \n" \
|
||||
"cmpl $0xC0000001, %%eax \n" \
|
||||
"movl $0, %%edx \n" \
|
||||
"jb unsupported \n" \
|
||||
"movl $0xC0000001, %%eax \n" \
|
||||
"cpuid \n" \
|
||||
"unsupported: \n" \
|
||||
"movl %%edx, %1 \n" \
|
||||
"movl %2, %%ebx \n"
|
||||
asm( "movl %%ebx, %0 \n\t"
|
||||
"movl $0xC0000000, %%eax \n\t"
|
||||
"cpuid \n\t"
|
||||
"cmpl $0xC0000001, %%eax \n\t"
|
||||
"movl $0, %%edx \n\t"
|
||||
"jb unsupported \n\t"
|
||||
"movl $0xC0000001, %%eax \n\t"
|
||||
"cpuid \n\t"
|
||||
"unsupported: \n\t"
|
||||
"movl %%edx, %1 \n\t"
|
||||
"movl %2, %%ebx \n\t"
|
||||
: "=m" (ebx), "=m" (edx)
|
||||
: "m" (ebx)
|
||||
: "eax", "ecx", "edx" );
|
||||
@ -89,15 +93,16 @@ int padlock_xcryptecb( aes_context *ctx,
|
||||
ctrl = blk + 4;
|
||||
*ctrl = 0x80 | ctx->nr | ( ( ctx->nr + ( mode^1 ) - 10 ) << 9 );
|
||||
|
||||
asm( "pushfl; popfl \n" \
|
||||
"movl %%ebx, %0 \n" \
|
||||
"movl $1, %%ecx \n" \
|
||||
"movl %2, %%edx \n" \
|
||||
"movl %3, %%ebx \n" \
|
||||
"movl %4, %%esi \n" \
|
||||
"movl %4, %%edi \n" \
|
||||
".byte 0xf3,0x0f,0xa7,0xc8\n" \
|
||||
"movl %1, %%ebx \n"
|
||||
asm( "pushfl \n\t"
|
||||
"popfl \n\t"
|
||||
"movl %%ebx, %0 \n\t"
|
||||
"movl $1, %%ecx \n\t"
|
||||
"movl %2, %%edx \n\t"
|
||||
"movl %3, %%ebx \n\t"
|
||||
"movl %4, %%esi \n\t"
|
||||
"movl %4, %%edi \n\t"
|
||||
".byte 0xf3,0x0f,0xa7,0xc8 \n\t"
|
||||
"movl %1, %%ebx \n\t"
|
||||
: "=m" (ebx)
|
||||
: "m" (ebx), "m" (ctrl), "m" (rk), "m" (blk)
|
||||
: "ecx", "edx", "esi", "edi" );
|
||||
@ -133,20 +138,21 @@ int padlock_xcryptcbc( aes_context *ctx,
|
||||
memcpy( iw, iv, 16 );
|
||||
|
||||
ctrl = iw + 4;
|
||||
*ctrl = 0x80 | ctx->nr | ( ( ctx->nr + (mode^1) - 10 ) << 9 );
|
||||
*ctrl = 0x80 | ctx->nr | ( ( ctx->nr + ( mode ^ 1 ) - 10 ) << 9 );
|
||||
|
||||
count = (length + 15) >> 4;
|
||||
count = ( length + 15 ) >> 4;
|
||||
|
||||
asm( "pushfl; popfl \n" \
|
||||
"movl %%ebx, %0 \n" \
|
||||
"movl %2, %%ecx \n" \
|
||||
"movl %3, %%edx \n" \
|
||||
"movl %4, %%ebx \n" \
|
||||
"movl %5, %%esi \n" \
|
||||
"movl %6, %%edi \n" \
|
||||
"movl %7, %%eax \n" \
|
||||
".byte 0xf3,0x0f,0xa7,0xd0\n" \
|
||||
"movl %1, %%ebx \n"
|
||||
asm( "pushfl \n\t"
|
||||
"popfl \n\t"
|
||||
"movl %%ebx, %0 \n\t"
|
||||
"movl %2, %%ecx \n\t"
|
||||
"movl %3, %%edx \n\t"
|
||||
"movl %4, %%ebx \n\t"
|
||||
"movl %5, %%esi \n\t"
|
||||
"movl %6, %%edi \n\t"
|
||||
"movl %7, %%eax \n\t"
|
||||
".byte 0xf3,0x0f,0xa7,0xd0 \n\t"
|
||||
"movl %1, %%ebx \n\t"
|
||||
: "=m" (ebx)
|
||||
: "m" (ebx), "m" (count), "m" (ctrl),
|
||||
"m" (rk), "m" (input), "m" (output), "m" (iw)
|
||||
@ -157,6 +163,6 @@ int padlock_xcryptcbc( aes_context *ctx,
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif /* POLARSSL_HAVE_X86 */
|
||||
|
||||
#endif
|
||||
#endif /* POLARSSL_PADLOCK_C */
|
||||
|
Reference in New Issue
Block a user