On 10/31/08, Andy Polyakov via RT <[EMAIL PROTECTED]> wrote:
> Could you please test the other suggested bn_lcl.h modification? While
>  you're on it...

I cannot actually test it... I can compile and users may test.
I don't have a win64 machine.
And I don't know how exactly I can check for speed...
I can send you binaries to test if you like.

>  >>> I am not fully sure that the crypto/sha/sha512.c is correct, it
>  >>> simulate the behavior of win64 using Microsoft compiler, using
>  >>> _rotr64 function as ROTR.
>  >> What you should have done instead is to modify macro in question
>  >> declaring ret as unsigned long long. If it doesn't work, then it's more
>  >> appropriate to leave ROTR undefined, i.e. *not* using _rotr64. Please
>  >> verify.
>  >
>  > Thanks, I converted this to SHA_LONG64 and it now compiles.
>
>
> Can you confirm that it even passes the test? I mean mere compilation
>  success doesn't qualify, it has to pass the test.

I will ask my users to run the sha512 test.

>
>  >> Also. As NT is natively UNICODE, and there are no non-NT Win64
>  >> implementations(*), there is no reason to favor legacy ANSI interfaces.
>  >> Could you verify that it compiles and works with -DUNICODE -D_UNICODE
>  >> added to config line?
>  >
>
> > This is too much work,
>
>
> Adding couple of words to config line?

I tried to... But then got many linkage error messages of _OBJ_ something.
Strange... Now I tried it on clean tree with same snapshot and it compiles.
Except one modification I had to do, updated in the patch.

> Quoting util/VC-32.pl: "As per 0.9.8 release remaining warnings were
>  explicitly examined and considered safe to ignore." It naturally does
>  not necessarily apply to HEAD, but there is awareness of the problem.

Well... I don't run this script :)

Attached is a new patch.

Thanks!
Alon.

diff -urNp openssl-SNAP-20081003/Configure openssl-SNAP-20081003.mingw64/Configure
--- openssl-SNAP-20081003/Configure	2008-09-16 00:00:05.000000000 +0300
+++ openssl-SNAP-20081003.mingw64/Configure	2008-10-20 12:37:37.000000000 +0200
@@ -496,6 +496,8 @@ my %table=(
 # MinGW
 "mingw", "gcc:-mno-cygwin -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall:::MINGW32:-lws2_32 -lgdi32:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts} EXPORT_VAR_AS_FN:${x86_coff_asm}:win32:cygwin-shared:-D_WINDLL -DOPENSSL_USE_APPLINK:-mno-cygwin:.dll.a",
 
+"mingw64", "gcc:-mno-cygwin -DL_ENDIAN -DUNICODE -D_UNICODE -DWIN32_LEAN_AND_MEAN -fomit-frame-pointer -O3 -Wall -D_WIN32_WINNT=0x333:::MINGW64:-lws2_32 -lgdi32:SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:${no_asm}:win32:cygwin-shared:-D_WINDLL:-mno-cygwin:.dll.a",
+
 # UWIN 
 "UWIN", "cc:-DTERMIOS -DL_ENDIAN -O -Wall:::UWIN::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:win32",
 
@@ -968,7 +970,7 @@ foreach (sort (keys %disabled))
 
 my $IsMK1MF=scalar grep /^$target$/,@MK1MF_Builds;
 
-$exe_ext=".exe" if ($target eq "Cygwin" || $target eq "DJGPP" || $target eq "mingw");
+$exe_ext=".exe" if ($target eq "Cygwin" || $target eq "DJGPP" || $target =~ /^mingw/);
 $exe_ext=".nlm" if ($target =~ /netware/);
 $exe_ext=".pm"  if ($target =~ /vos/);
 $openssldir="/usr/local/ssl" if ($openssldir eq "" and $prefix eq "");
--- openssl-SNAP-20081003/engines/e_aep.c	2008-01-04 01:01:24.000000000 +0200
+++ openssl-SNAP-20081003.mingw64/engines/e_aep.c	2008-10-20 12:46:24.000000000 +0200
@@ -62,8 +62,10 @@
 #include <unistd.h>
 #else
 #include <process.h>
+#ifndef _PID_T_
 typedef int pid_t;
+#endif
 #endif
 
 #if defined(OPENSSL_SYS_NETWARE) && defined(NETWARE_CLIB)
 #define getpid GetThreadID
diff -urNp openssl-SNAP-20081028.org/crypto/sha/sha512.c openssl-SNAP-20081028/crypto/sha/sha512.c
--- openssl-SNAP-20081028/crypto/sha/sha512.c	2008-04-24 13:00:12.000000000 +0300
+++ openssl-SNAP-20081028.mingw64/crypto/sha/sha512.c	2008-10-30 22:41:20.000000000 +0200
@@ -350,7 +350,7 @@ static const SHA_LONG64 K512[80] = {
 #ifndef PEDANTIC
 # if defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)
 #  if defined(__x86_64) || defined(__x86_64__)
-#   define ROTR(a,n)	({ unsigned long ret;		\
+#   define ROTR(a,n)	({ SHA_LONG64 ret;	\
 				asm ("rorq %1,%0"	\
 				: "=r"(ret)		\
 				: "J"(n),"0"(a)		\
--- openssl-SNAP-20081028/apps/speed.c	2008-10-30 22:59:03.000000000 +0200
+++ openssl-SNAP-20081028.mingw64/apps/speed.c	2008-10-30 22:59:16.000000000 +0200
@@ -281,7 +281,7 @@ static double Time_F(int s)
 		if (thr==NULL)
 			{
 			DWORD ret=GetLastError();
-			BIO_printf(bio_err,"unable to CreateThread (%d)",ret);
+			BIO_printf(bio_err,"unable to CreateThread (%ld)",ret);
 			ExitProcess(ret);
 			}
 		CloseHandle(thr);		/* detach the thread	*/
--- openssl-SNAP-20081028/crypto/bio/bss_log.c	2008-10-31 14:32:17.000000000 +0200
+++ openssl-SNAP-20081028.mingw64/crypto/bio/bss_log.c	2008-10-31 14:24:51.000000000 +0200
@@ -71,6 +71,7 @@
 #if defined(OPENSSL_SYS_WINCE)
 #elif defined(OPENSSL_SYS_WIN32)
 #  include <process.h>
+#  include <tchar.h>
 #elif defined(OPENSSL_SYS_VMS)
 #  include <opcdef.h>
 #  include <descrip.h>
@@ -253,7 +252,7 @@ static void xopenlog(BIO* bp, char* name
 	if ( !register_event_source )
 		{
 		HANDLE	advapi;
-		if ( !(advapi = GetModuleHandle("advapi32")) )
+		if ( !(advapi = GetModuleHandle(_T("advapi32"))) )
 			return;
 		register_event_source = (HANDLE (WINAPI *)())DL_PROC_X(advapi,
 			"RegisterEventSource" );

Reply via email to