Topic: Code using SHA-512 not compiling in Linux

Hi,

I enabled the sha512 during the ./configure step and although i can use every other sha variant in my code, trying to use sha512 gives me "Type 'Sha512' could not be resolved"

The header file is included as well, can't see whats going wrong. I am using 2.4.0 wolfSSL embedded SSL library on Ubuntu. Please help sad

Share

Re: Code using SHA-512 not compiling in Linux

Hi,

From what I understand, you have built wolfSSL with SHA-512 support (--enable-sha512) and installed the library (sudo make install).  Are you including the sha512.h header?

#include <wolfssl/wolfcrypt/sha512.h>

And are you defining WOLFSSL_SHA512 when you build your application?  For example:

gcc main.c -lwolfssl -DWOLFSSL_SHA512

Best Regards,
Chris

Re: Code using SHA-512 not compiling in Linux

Hi Chris,

Thanks a lot for the response. The -DWOLFSSL_SHA512 option did the trick, it should also be mentioned in the manual esp for C newbies like me smile

I still can't make it work on Eclipse IDE though (even after including the -D option) but at least its compiling and running from command-line. Maybe its because Eclipse compiles and links at separate stages. If you have any experience on that I will be very grateful for your advice. I've to use eclipse as I have to use the Valgrind profiling plugin that comes with it. Again, thanks a lot smile

Share

Re: Code using SHA-512 not compiling in Linux

Hi ruhmatahir,

I was able to build a simple SHA-512 application with wolfSSL in Eclipse on OS X by doing the following:

1)  Add the WOLFSSL_SHA512 define (set with a value of "1") in [Project Properties] -> [C/C++ General] -> [Paths and Symbols] -> [Symbols]

2)  Under [Project Properties] -> [C/C++ Build] -> [Settings] -> [Linker section] -> [Libraries], then click the "plus" button and add an entry for "wolfssl" to tell Eclipse to link to the wolfSSL library.

Does this work on your end?

Best Regards,
Chris

Re: Code using SHA-512 not compiling in Linux

Hi Chris,

Only needed step 1, I had already figured out step 2. Works like a charm now ..... thanks a lot for your great help big_smile

Regards,
Ruhma

Share