Hi Kaleb,
Thank you for the fast reply.
Can you tell us about your project and what it is you are working on!
I'm just experimenting and need few simple crypto functions: RC4, MD4, MD5, SHA256, HMAC. Maybe AES later.
Here is a steps what I did.
Download wolfSSL from Git and unzip it to C:\Projects\wolfssl
Open wolfssl64.sln solution and press F7 to build it. Checked that compilation succesful. Close solution.
Create new empty C++ solution. Place one file with code I placed in initial post.
In project properties:
in C/C++ options add C:\Projects\wolfssl into Additional Include Directories
in Linker options add C:\Projects\wolfssl\Debug into Additional Library Directories
in Linker options add wolfssl.lib into Additional Dependencies
Thanks for using the wolfSSL forums to seek an answer. Often times if the application does not have all the same settings as the wolfSSL library this can result in undefined behavior. Could you send us the contents of the user_settings.h and any C Pre Processor macros you have set in your project that are wolfSSL specific?
I have not touch user_settings.h nither add anything to C++ Preprocessor Definitions.
C++ Preprocessor Definitions has only: _MBCS
If you are not using a user_settings.h and you do NOT have WOLFSSL_USER_SETTINGS set in your project please try adding that define to your Preprocessor flags and then make sure the path to wolfssl-x.xx.x/IDE/WIN is in your project include path so that wolfssl-x.xx.x/IDE/WIN/user_settings.h gets pulled in!
I did those two more modifications which you have suggested.
add WOLFSSL_USER_SETTINGS to C++ Preprocessor Definitions.
Resulting value: WOLFSSL_USER_SETTINGS;_MBCS
add C:\Projects\wolfssl\IDE\WIN into Additional Include Directories
Resulting value: C:\Projects\wolfssl\;C:\Projects\wolfssl\IDE\WIN\
Above changes did not help:
digest 0
aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
digest 1
aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
1b 20 7b b8 31 dd 2e 4e e3 bc 4a f2 83 94 ad 61
aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
f8 a8 c0 1c 39 4c e1 96 ea de 12 bb 9f 53 84 0e
I also found that the "key" value passed to wc_HmacSetKey also becomes corrupted.
I did not notice any problems with MD4, MD5 and RC4.
Thanks