I am compiling wolfssl with x64 gcc included in Mingw-w64.
Everything works fine in the examples except from ECC.
The same code, compiled with 32bits gcc works fine.
Here's the warnings when compiling:
/ctaocrypt/src/misc.c:161:10: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
if (((cyassl_word)buf | (cyassl_word)mask | count) % CYASSL_WORD_SIZE == 0)
^
/ctaocrypt/src/misc.c:161:29: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
if (((cyassl_word)buf | (cyassl_word)mask | count) % CYASSL_WORD_SIZE == 0)
^
\ctaocrypt\src\ecc.c:1080:12: warning: right shift count >= width of type
i = (int)(buf >> (DIGIT_BIT - 1)) & 1;
^
I can fix the shift warning both by casting buf to an UINT64:
i = (int)((UINT64)buf >> (DIGIT_BIT - 1)) & 1;
or by modifying its type to a unsigned long long.
About the other warning, it is in function 'xorbuf'. As far as I know, cyassl_word is 64bits and the pointers should also be 64 bits. So I don't really know what is causing the problem.
I am defining:
WIN32
_WIN32
WIN64
_WIN64
HAVE_AESCCM
CYASSL_DTLS
HAVE_ECC