Large diffs are not rendered by default.

@@ -2,7 +2,7 @@ TITLE sha512-586.asm
IF @Version LT 800
ECHO MASM version 8.00 or later is strongly recommended.
ENDIF
.586
.686
.MODEL FLAT
OPTION DOTNAME
IF @Version LT 800
@@ -104,31 +104,30 @@ ALIGN 16
$L00300_15:
mov ebx,DWORD PTR 92[esp]
mov ecx,edx
ror ecx,6
mov edi,edx
ror edi,11
ror ecx,14
mov esi,DWORD PTR 20[esp]
xor ecx,edi
ror edi,14
xor ecx,edi
xor ecx,edx
ror ecx,5
xor ecx,edx
ror ecx,6
mov edi,DWORD PTR 24[esp]
add ebx,ecx
mov DWORD PTR 16[esp],edx
xor esi,edi
mov DWORD PTR 16[esp],edx
mov ecx,eax
and esi,edx
mov edx,DWORD PTR 12[esp]
xor esi,edi
mov edi,eax
add ebx,esi
ror ecx,2
ror ecx,9
add ebx,DWORD PTR 28[esp]
ror edi,13
xor ecx,eax
ror ecx,11
mov esi,DWORD PTR 4[esp]
xor ecx,edi
ror edi,9
xor ecx,eax
ror ecx,2
add edx,ebx
xor ecx,edi
mov edi,DWORD PTR 8[esp]
add ebx,ecx
mov DWORD PTR [esp],eax
@@ -150,48 +149,46 @@ ALIGN 16
$L00416_63:
mov esi,ebx
mov ecx,DWORD PTR 100[esp]
shr ebx,3
ror esi,7
xor ebx,esi
ror esi,11
mov edi,ecx
xor esi,ebx
ror esi,7
shr ebx,3
ror edi,2
xor ebx,esi
shr ecx,10
mov esi,DWORD PTR 156[esp]
xor edi,ecx
ror edi,17
xor ecx,edi
ror edi,2
add ebx,esi
shr ecx,10
add ebx,DWORD PTR 156[esp]
xor edi,ecx
add ebx,edi
mov ecx,edx
add ebx,DWORD PTR 120[esp]
ror ecx,6
mov edi,edx
ror edi,11
mov ecx,edx
add ebx,edi
ror ecx,14
mov esi,DWORD PTR 20[esp]
xor ecx,edi
ror edi,14
xor ecx,edx
ror ecx,5
mov DWORD PTR 92[esp],ebx
xor ecx,edi
xor ecx,edx
ror ecx,6
mov edi,DWORD PTR 24[esp]
add ebx,ecx
mov DWORD PTR 16[esp],edx
xor esi,edi
mov DWORD PTR 16[esp],edx
mov ecx,eax
and esi,edx
mov edx,DWORD PTR 12[esp]
xor esi,edi
mov edi,eax
add ebx,esi
ror ecx,2
ror ecx,9
add ebx,DWORD PTR 28[esp]
ror edi,13
xor ecx,eax
ror ecx,11
mov esi,DWORD PTR 4[esp]
xor ecx,edi
ror edi,9
xor ecx,eax
ror ecx,2
add edx,ebx
xor ecx,edi
mov edi,DWORD PTR 8[esp]
add ebx,ecx
mov DWORD PTR [esp],eax
@@ -2,7 +2,7 @@ TITLE sha512-586.asm
IF @Version LT 800
ECHO MASM version 8.00 or later is strongly recommended.
ENDIF
.586
.686
.MODEL FLAT
OPTION DOTNAME
IF @Version LT 800
@@ -2,7 +2,7 @@ TITLE x86cpuid.asm
IF @Version LT 800
ECHO MASM version 8.00 or later is strongly recommended.
ENDIF
.586
.686
.MODEL FLAT
OPTION DOTNAME
IF @Version LT 800
@@ -27,9 +27,9 @@ $L_OPENSSL_ia32_cpuid_begin::
pushfd
pop eax
xor ecx,eax
bt ecx,21
jnc $L000done
xor eax,eax
bt ecx,21
jnc $L000nocpuid
cpuid
mov edi,eax
xor eax,eax
@@ -55,7 +55,14 @@ $L_OPENSSL_ia32_cpuid_begin::
jnz $L001intel
mov eax,2147483648
cpuid
cmp eax,2147483656
cmp eax,2147483649
jb $L001intel
mov esi,eax
mov eax,2147483649
cpuid
or ebp,ecx
and ebp,2049
cmp esi,2147483656
jb $L001intel
mov eax,2147483656
cpuid
@@ -64,46 +71,68 @@ $L_OPENSSL_ia32_cpuid_begin::
mov eax,1
cpuid
bt edx,28
jnc $L000done
jnc $L002generic
shr ebx,16
and ebx,255
cmp ebx,esi
ja $L000done
ja $L002generic
and edx,4026531839
jmp $L000done
jmp $L002generic
$L001intel:
cmp edi,4
mov edi,-1
jb $L002nocacheinfo
jb $L003nocacheinfo
mov eax,4
mov ecx,0
cpuid
mov edi,eax
shr edi,14
and edi,4095
$L002nocacheinfo:
$L003nocacheinfo:
mov eax,1
cpuid
and edx,3220176895
cmp ebp,0
jne $L003notP4
jne $L004notintel
or edx,1073741824
and ah,15
cmp ah,15
jne $L003notP4
jne $L004notintel
or edx,1048576
$L003notP4:
$L004notintel:
bt edx,28
jnc $L000done
jnc $L002generic
and edx,4026531839
cmp edi,0
je $L000done
je $L002generic
or edx,268435456
shr ebx,16
cmp bl,1
ja $L000done
ja $L002generic
and edx,4026531839
$L000done:
mov eax,edx
mov edx,ecx
$L002generic:
and ebp,2048
and ecx,4294965247
mov esi,edx
or ebp,ecx
bt ecx,27
jnc $L005clear_avx
xor ecx,ecx
DB 15,1,208
and eax,6
cmp eax,6
je $L006done
cmp eax,2
je $L005clear_avx
$L007clear_xmm:
and ebp,4261412861
and esi,4278190079
$L005clear_avx:
and ebp,4026525695
$L006done:
mov eax,esi
mov edx,ebp
$L000nocpuid:
pop edi
pop esi
pop ebx
@@ -118,24 +147,24 @@ $L_OPENSSL_rdtsc_begin::
xor edx,edx
lea ecx,DWORD PTR _OPENSSL_ia32cap_P
bt DWORD PTR [ecx],4
jnc $L004notsc
jnc $L008notsc
rdtsc
$L004notsc:
$L008notsc:
ret
_OPENSSL_rdtsc ENDP
ALIGN 16
_OPENSSL_instrument_halt PROC PUBLIC
$L_OPENSSL_instrument_halt_begin::
lea ecx,DWORD PTR _OPENSSL_ia32cap_P
bt DWORD PTR [ecx],4
jnc $L005nohalt
jnc $L009nohalt
DD 2421723150
and eax,3
jnz $L005nohalt
jnz $L009nohalt
pushfd
pop eax
bt eax,9
jnc $L005nohalt
jnc $L009nohalt
rdtsc
push edx
push eax
@@ -145,7 +174,7 @@ DD 2421723150
sbb edx,DWORD PTR 4[esp]
add esp,8
ret
$L005nohalt:
$L009nohalt:
xor eax,eax
xor edx,edx
ret
@@ -156,21 +185,21 @@ $L_OPENSSL_far_spin_begin::
pushfd
pop eax
bt eax,9
jnc $L006nospin
jnc $L010nospin
mov eax,DWORD PTR 4[esp]
mov ecx,DWORD PTR 8[esp]
DD 2430111262
xor eax,eax
mov edx,DWORD PTR [ecx]
jmp $L007spin
jmp $L011spin
ALIGN 16
$L007spin:
$L011spin:
inc eax
cmp edx,DWORD PTR [ecx]
je $L007spin
je $L011spin
DD 529567888
ret
$L006nospin:
$L010nospin:
xor eax,eax
xor edx,edx
ret
@@ -183,9 +212,9 @@ $L_OPENSSL_wipe_cpu_begin::
lea ecx,DWORD PTR _OPENSSL_ia32cap_P
mov ecx,DWORD PTR [ecx]
bt DWORD PTR [ecx],1
jnc $L008no_x87
jnc $L012no_x87
DD 4007259865,4007259865,4007259865,4007259865,2430851995
$L008no_x87:
$L012no_x87:
lea eax,DWORD PTR 4[esp]
ret
_OPENSSL_wipe_cpu ENDP
@@ -197,11 +226,11 @@ $L_OPENSSL_atomic_add_begin::
push ebx
nop
mov eax,DWORD PTR [edx]
$L009spin:
$L013spin:
lea ebx,DWORD PTR [ecx*1+eax]
nop
DD 447811568
jne $L009spin
jne $L013spin
mov eax,ebx
pop ebx
ret
@@ -238,37 +267,50 @@ $L_OPENSSL_cleanse_begin::
mov ecx,DWORD PTR 8[esp]
xor eax,eax
cmp ecx,7
jae $L010lot
jae $L014lot
cmp ecx,0
je $L011ret
$L012little:
je $L015ret
$L016little:
mov BYTE PTR [edx],al
sub ecx,1
lea edx,DWORD PTR 1[edx]
jnz $L012little
$L011ret:
jnz $L016little
$L015ret:
ret
ALIGN 16
$L010lot:
$L014lot:
test edx,3
jz $L013aligned
jz $L017aligned
mov BYTE PTR [edx],al
lea ecx,DWORD PTR [ecx-1]
lea edx,DWORD PTR 1[edx]
jmp $L010lot
$L013aligned:
jmp $L014lot
$L017aligned:
mov DWORD PTR [edx],eax
lea ecx,DWORD PTR [ecx-4]
test ecx,-4
lea edx,DWORD PTR 4[edx]
jnz $L013aligned
jnz $L017aligned
cmp ecx,0
jne $L012little
jne $L016little
ret
_OPENSSL_cleanse ENDP
ALIGN 16
_OPENSSL_ia32_rdrand PROC PUBLIC
$L_OPENSSL_ia32_rdrand_begin::
mov ecx,8
$L018loop:
DB 15,199,240
jc $L019break
loop $L018loop
$L019break:
cmp eax,0
cmove eax,ecx
ret
_OPENSSL_ia32_rdrand ENDP
.text$ ENDS
.bss SEGMENT 'BSS'
COMM _OPENSSL_ia32cap_P:DWORD
COMM _OPENSSL_ia32cap_P:QWORD
.bss ENDS
.CRT$XCU SEGMENT DWORD PUBLIC 'DATA'
EXTERN _OPENSSL_cpuid_setup:NEAR

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

@@ -0,0 +1,333 @@
/* opensslconf.h */
/* WARNING: Generated automatically from opensslconf.h.in by Configure. */

/* OpenSSL was configured with the following options: */
#undef OPENSSL_SYSNAME_WIN32
#if defined(_WIN32)
# define OPENSSL_SYSNAME_WIN32
#endif

#ifndef OPENSSL_DOING_MAKEDEPEND
# ifndef OPENSSL_NO_CAPIENG
# define OPENSSL_NO_CAPIENG
# endif
# ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
# define OPENSSL_NO_EC_NISTP_64_GCC_128
# endif
# ifndef OPENSSL_NO_GMP
# define OPENSSL_NO_GMP
# endif
# ifndef OPENSSL_NO_GOST
# define OPENSSL_NO_GOST
# endif
# ifndef OPENSSL_NO_HW_PADLOCK
# define OPENSSL_NO_HW_PADLOCK
# endif
# ifndef OPENSSL_NO_JPAKE
# define OPENSSL_NO_JPAKE
# endif
# ifndef OPENSSL_NO_KRB5
# define OPENSSL_NO_KRB5
# endif
# ifndef OPENSSL_NO_MD2
# define OPENSSL_NO_MD2
# endif
# ifndef OPENSSL_NO_RC5
# define OPENSSL_NO_RC5
# endif
# ifndef OPENSSL_NO_RFC3779
# define OPENSSL_NO_RFC3779
# endif
# ifndef OPENSSL_NO_SCTP
# define OPENSSL_NO_SCTP
# endif
# ifndef OPENSSL_NO_STORE
# define OPENSSL_NO_STORE
# endif
#endif /* OPENSSL_DOING_MAKEDEPEND */

#ifndef OPENSSL_THREADS
# define OPENSSL_THREADS
#endif
#ifndef OPENSSL_NO_DYNAMIC_ENGINE
# define OPENSSL_NO_DYNAMIC_ENGINE
#endif

/* The OPENSSL_NO_* macros are also defined as NO_* if the application
asks for it. This is a transient feature that is provided for those
who haven't had the time to do the appropriate changes in their
applications. */
#ifdef OPENSSL_ALGORITHM_DEFINES
# if defined(OPENSSL_NO_CAMELLIA) && !defined(NO_CAMELLIA)
# define NO_CAMELLIA
# endif
# if defined(OPENSSL_NO_CAPIENG) && !defined(NO_CAPIENG)
# define NO_CAPIENG
# endif
# if defined(OPENSSL_NO_CAST) && !defined(NO_CAST)
# define NO_CAST
# endif
# if defined(OPENSSL_NO_CMS) && !defined(NO_CMS)
# define NO_CMS
# endif
# if defined(OPENSSL_NO_FIPS) && !defined(NO_FIPS)
# define NO_FIPS
# endif
# if defined(OPENSSL_NO_GMP) && !defined(NO_GMP)
# define NO_GMP
# endif
# if defined(OPENSSL_NO_IDEA) && !defined(NO_IDEA)
# define NO_IDEA
# endif
# if defined(OPENSSL_NO_JPAKE) && !defined(NO_JPAKE)
# define NO_JPAKE
# endif
# if defined(OPENSSL_NO_KRB5) && !defined(NO_KRB5)
# define NO_KRB5
# endif
# if defined(OPENSSL_NO_MD2) && !defined(NO_MD2)
# define NO_MD2
# endif
# if defined(OPENSSL_NO_MDC2) && !defined(NO_MDC2)
# define NO_MDC2
# endif
# if defined(OPENSSL_NO_RC5) && !defined(NO_RC5)
# define NO_RC5
# endif
# if defined(OPENSSL_NO_RFC3779) && !defined(NO_RFC3779)
# define NO_RFC3779
# endif
# if defined(OPENSSL_NO_SEED) && !defined(NO_SEED)
# define NO_SEED
# endif
# if defined(OPENSSL_NO_SHA0) && !defined(NO_SHA0)
# define NO_SHA0
# endif
# if defined(OPENSSL_NO_STORE) && !defined(NO_STORE)
# define NO_STORE
# endif
# if defined(OPENSSL_NO_WHRLPOOL) && !defined(NO_WHRLPOOL)
# define NO_WHRLPOOL
# endif
# if defined(OPENSSL_NO_MDC2) && !defined(NO_MDC2)
# define NO_MDC2
# endif
#endif

/* crypto/opensslconf.h.in */

#ifdef OPENSSL_DOING_MAKEDEPEND
/* Include any symbols here that have to be explicitly set to enable a feature
* that should be visible to makedepend.
*
* [Our "make depend" doesn't actually look at this, we use actual build settings
* instead; we want to make it easy to remove subdirectories with disabled algorithms.]
*/
# ifndef OPENSSL_FIPS
# define OPENSSL_FIPS
# endif
#endif

/* Generate 80386 code? */
#undef I386_ONLY

#if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */
# if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR)
# if defined(_WIN32)
# define ENGINESDIR "ssl/lib/engines"
# define OPENSSLDIR "ssl"
# else
# define ENGINESDIR "/usr/local/ssl/lib/engines"
# define OPENSSLDIR "/usr/local/ssl"
# endif
# endif
#endif

#undef OPENSSL_UNISTD
#define OPENSSL_UNISTD <unistd.h>
#if !defined(_WIN32) && !defined(__arm__) && !defined(SWIG)
# include <unistd.h>
#endif

#undef OPENSSL_EXPORT_VAR_AS_FUNCTION
#if defined(_WIN32)
# define OPENSSL_EXPORT_VAR_AS_FUNCTION
#endif

#if defined(HEADER_IDEA_H)
# undef IDEA_INT
# define IDEA_INT unsigned int
#endif

#if defined(HEADER_MD2_H)
# undef MD2_INT
# define MD2_INT unsigned int
#endif

#if defined(HEADER_RC2_H)
/* I need to put in a mod for the alpha - eay */
# undef RC2_INT
# define RC2_INT unsigned int
#endif

#if defined(HEADER_RC4_H)
/* using int types make the structure larger but make the code faster
* on most boxes I have tested - up to %20 faster. */
/*
* I don't know what does "most" mean, but declaring "int" is a must on:
* - Intel P6 because partial register stalls are very expensive;
* - elder Alpha because it lacks byte load/store instructions;
*/
# undef RC4_INT
# if defined(__arm__)
# define RC4_INT unsigned char
# else
# define RC4_INT unsigned int
# endif

/*
* This enables code handling data aligned at natural CPU word
* boundary. See crypto/rc4/rc4_enc.c for further details.
*/
# undef RC4_CHUNK
# if (defined(_M_X64) || defined(__x86_64__)) && defined(_WIN32)
# define RC4_CHUNK unsigned long long
# elif (defined(_M_X64) || defined(__x86_64__)) && !defined(_WIN32)
# define RC4_CHUNK unsigned long
# elif defined(__arm__)
# define RC4_CHUNK unsigned long
# else
/* On x86 RC4_CHUNK is not defined */
# endif
#endif

#if defined(HEADER_NEW_DES_H) || defined(HEADER_DES_H)
/* If this is set to 'unsigned int' on a DEC Alpha, this gives about a
* %20 speed up (longs are 8 bytes, int's are 4). */
# undef DES_LONG
# if defined(_M_X64) || defined(__x86_64__) || defined(__arm__)
# define DES_LONG unsigned int
# elif defined(_M_IX86) || defined(__i386__)
# define DES_LONG unsigned long
# endif
#endif

#if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H)
# define CONFIG_HEADER_BN_H

# undef BL_LLONG
# if defined(_M_IX86) || defined(__i386__) || defined(__arm__)
# define BL_LLONG
# endif

/* Should we define BN_DIV2W here? */

/* Only one for the following should be defined */
/* The prime number generation stuff may not work when
* EIGHT_BIT but I don't care since I've only used this mode
* for debuging the bignum libraries */
# undef SIXTY_FOUR_BIT_LONG
# undef SIXTY_FOUR_BIT
# undef THIRTY_TWO_BIT
# undef SIXTEEN_BIT
# undef EIGHT_BIT
# if (defined(_M_X64) || defined(__x86_64__)) && defined(_WIN32)
# define SIXTY_FOUR_BIT
# elif (defined(_M_X64) || defined(__x86_64__)) && !defined(_WIN32)
# define SIXTY_FOUR_BIT_LONG
# elif defined(_M_IX86) || defined(__i386__) || defined(__arm__)
# define THIRTY_TWO_BIT
# endif
#endif

#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H)
# define CONFIG_HEADER_RC4_LOCL_H
/* if this is defined data[i] is used instead of *data, this is a %20
* speedup on x86 */
# undef RC4_INDEX
# if defined(_M_IX86) || defined(__i386__)
# define RC4_INDEX
# endif
#endif

#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H)
# define CONFIG_HEADER_BF_LOCL_H
# undef BF_PTR
# if defined(__arm__)
# define BF_PTR
# endif
#endif /* HEADER_BF_LOCL_H */

#if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H)
# define CONFIG_HEADER_DES_LOCL_H

# ifndef DES_DEFAULT_OPTIONS
/* the following is tweaked from a config script, that is why it is a
* protected undef/define */
# undef DES_PTR
# if !defined(_WIN32) && (defined(_M_IX86) || defined(__i386__))
# define DES_PTR
# endif

/* This helps C compiler generate the correct code for multiple functional
* units. It reduces register dependancies at the expense of 2 more
* registers */
# undef DES_RISC1
# if !defined(_WIN32) && (defined(_M_IX86) || defined(__i386__))
# define DES_RISC1
# endif

# undef DES_RISC2

# if defined(DES_RISC1) && defined(DES_RISC2)
# error YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
# endif

/* Unroll the inner loop, this sometimes helps, sometimes hinders.
* Very mucy CPU dependant */
# undef DES_UNROLL
# if !defined(_WIN32)
# define DES_UNROLL
# endif

/* These default values were supplied by
* Peter Gutman <pgut001@cs.auckland.ac.nz>
* They are only used if nothing else has been defined */
# if !defined(DES_PTR) && !defined(DES_RISC1) && !defined(DES_RISC2) && !defined(DES_UNROLL)
/* Special defines which change the way the code is built depending on the
CPU and OS. For SGI machines you can use _MIPS_SZLONG (32 or 64) to find
even newer MIPS CPU's, but at the moment one size fits all for
optimization options. Older Sparc's work better with only UNROLL, but
there's no way to tell at compile time what it is you're running on */
# if defined( sun ) /* Newer Sparc's */
# define DES_PTR
# define DES_RISC1
# define DES_UNROLL
# elif defined( __ultrix ) /* Older MIPS */
# define DES_PTR
# define DES_RISC2
# define DES_UNROLL
# elif defined( __osf1__ ) /* Alpha */
# define DES_PTR
# define DES_RISC2
# elif defined ( _AIX ) /* RS6000 */
/* Unknown */
# elif defined( __hpux ) /* HP-PA */
/* Unknown */
# elif defined( __aux ) /* 68K */
/* Unknown */
# elif defined( __dgux ) /* 88K (but P6 in latest boxes) */
# define DES_UNROLL
# elif defined( __sgi ) /* Newer MIPS */
# define DES_PTR
# define DES_RISC2
# define DES_UNROLL
# elif defined(i386) || defined(__i386__) /* x86 boxes, should be gcc */
# define DES_PTR
# define DES_RISC1
# define DES_UNROLL
# endif /* Systems-specific speed defines */
# endif

# endif /* DES_DEFAULT_OPTIONS */
#endif /* HEADER_DES_LOCL_H */

This file was deleted.

This file was deleted.

This file was deleted.

Large diffs are not rendered by default.

@@ -2054,8 +2054,8 @@ ()
&test ($s2,15);
&jnz (&label("slow_way"));
if (!$x86only) {
&bt (&DWP(0,$s0),28); # check for hyper-threading bit
&jc (&label("slow_way"));
#&bt (&DWP(0,$s0),28); # check for hyper-threading bit
#&jc (&label("slow_way"));
}
# pre-allocate aligned stack frame...
&lea ($acc,&DWP(-80-244,"esp"));
@@ -1683,8 +1683,8 @@ ()
jb .Lcbc_slow_prologue
test \$15,%rdx
jnz .Lcbc_slow_prologue
bt \$28,%r10d
jc .Lcbc_slow_prologue
#bt \$28,%r10d
#jc .Lcbc_slow_prologue
# allocate aligned stack frame...
lea -88-248(%rsp),$key
@@ -718,7 +718,7 @@ void OPENSSL_cpuid_setup(void)
unsigned long *OPENSSL_ia32cap_loc(void) { return NULL; }
#endif
int OPENSSL_NONPIC_relocated = 0;
#if !defined(OPENSSL_CPUID_SETUP)
#if !defined(OPENSSL_CPUID_SETUP) && !defined(OPENSSL_CPUID_OBJ)
void OPENSSL_cpuid_setup(void) {}
#endif

@@ -0,0 +1 @@
#include "../../config/opensslconf.h"
@@ -79,7 +79,7 @@ sub ::file
IF \@Version LT 800
ECHO MASM version 8.00 or later is strongly recommended.
ENDIF
.486
.686
.MODEL FLAT
OPTION DOTNAME
IF \@Version LT 800
@@ -0,0 +1 @@
#include "../../crypto/opensslconf.h"