Topic: Visual Studio Project, Cyassl 2.4, x86_x64 settings?

I'm sure it's something simple, but what settings/modifications need to be made to take the visual studio project provided with 2.4 and make it build on x64 Windows 7 (VS 2008).

When I change the project configuration to x64 I get the following errors:

misc.c(164) : warning C4305: 'type cast' : truncation from 'byte *' to 'word'

integer.c(3227): warning C4334: '<<' : result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)

ssl.h(31) : fatal error C1083: Cannot open include file: 'cyassl/version.h': No such file or directory

When I do nothing and just use Win32 I still get the version.h error, that looks like a simple fix, but I just can't shake the feeling I'm missing a step.

-hz

Share

Re: Visual Studio Project, Cyassl 2.4, x86_x64 settings?

Upon further inspection it appears that:

mp_sqr (&M[1 << (winsize - 1)], &M[1 << (winsize - 1)])) != MP_OKAY) {

might need to be:

mp_sqr (&M[1i64  << (winsize - 1)], &M[1 << (winsize - 1)])) != MP_OKAY) {

As nearest I can tell the resultant pointer is 64bits in size, so wouldn't you need to 64bit shift operation?

I appears the compiler figures that out, but I just wanted to see if I was mistaken.

Thanks!

Share

Re: Visual Studio Project, Cyassl 2.4, x86_x64 settings?

Also noted there's a number of conversions from size_t to int in ssl.c and internal.c, at this point it's got to be some define I'm missing..

internal.c(4821) : warning C4267: '=' : conversion from 'size_t' to 'word32', possible loss of data

ssl.c(87) : warning C4267: 'initializing' : conversion from 'size_t' to 'unsigned int', possible loss of data
ssl.c(1403) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
ssl.c(1566) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
ssl.c(2087) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
ssl.c(6567) : warning C4267: 'function' : conversion from 'size_t' to 'word32', possible loss of data

Share

Re: Visual Studio Project, Cyassl 2.4, x86_x64 settings?

Thanks for the reports.

1) How did you get our embedded SSL source?  The downloadable 2.4.0 should have cyassl/version.h in the .zip.  Our github tree also has it checked in although there was a day where it was missing in the last couple weeks.

2) The latest github tree now has fixes for all of these warnings on Windows x64 except for...

3) The 64 bit shift warning.  Using i64 isn't portable.  We do have a somewhat portable 64bit macro W64LIT except for platforms that don't have 64bit types available of course.  It doesn't make any sense to me to have the index of the array use a 64 bit type, especially since it isn't portable to many of our platforms.  We could explicitly cast the shift to 32 bits but that just makes the code harder to read there.  I'm going to leave that warning for now.  We'll discuss it at our next meeting.

Thanks again for the reports.

Share