Topic: Linker errors

I am currently working on a wrapper using wolfcrpypt, and im running into a a couple of problems and im not sure why.

1. I have wolfssl/wolfcrypt/Blake2B.h included, and i have the wolfssl static lib i compiled from the solution provided with the wolfssl download, and i am getting linker errors saying that the Init, Update, & Final Blake2B hashing funcs are unresolved.

https://puu.sh/F9nFx/6485c5e1c0.png

2. Even though I have Blake2B.h included, I have to define HAVE_BLAKE2 and HAVE_BLAKE2B otherwise the functions wc_InitBlake2b, wc_Blake2bUpdate, and wc_Blake2bFinal are undefined,is this intentional? Because for MD4/5 and SHA/SHA256 I dont have to define anything for the funcs defined in the header to be recognized by VS, however with SHA224/SHA384/SHA512 and Blake2B/Blake2S I have to define the associated preprocessor definitions otherwise the functions are undefined when trying to call them

https://puu.sh/F9nFe/9f6a15ebe5.png

Share

Re: Linker errors

@ThaPrintz,

Thank you so much for reaching out with your questions.

Please try adding the settings to a custom user_settings.h and globally define WOLFSSL_USER_SETTINGS. At the application level you need to always include the <wolfssl/wolfcrypt/settings.h> before any other wolfSSL headers.

All other custom settings like user_settings.h should be included inside wolfssl/wolfcrypt/settings.h. user_settings.h is included in wolfssl/wolfcrypt/settings.h when WOLFSSL_USER_SETTINGS is defined globally.

Regards,

K

3 (edited by ThaPrintz 2020-02-13 03:25:22)

Re: Linker errors

Kaleb J. Himes wrote:

@ThaPrintz,

Thank you so much for reaching out with your questions.

Please try adding the settings to a custom user_settings.h and globally define WOLFSSL_USER_SETTINGS. At the application level you need to always include the <wolfssl/wolfcrypt/settings.h> before any other wolfSSL headers.

All other custom settings like user_settings.h should be included inside wolfssl/wolfcrypt/settings.h. user_settings.h is included in wolfssl/wolfcrypt/settings.h when WOLFSSL_USER_SETTINGS is defined globally.

Regards,

K

Kaleb,

Thanks for you response, however i do have WOLFSSL_USER_SETTINS globally defined, and i do have user_settings.h (this is where all my HAVE_MD2, HAVE_SHA256, etc etc are located).

I still get linker errors for:

  • MD2

  • Blake2B/S

  • poly1305

  • Camellia

  • HC128

  • ChaCha

  • RSA

All of the other cryptographic methods compile fine with no linker errors

Share

Re: Linker errors

ThaPrintz,

There are some features that are default enabled and to turn them off you use a setting like NO_<FEATURE> IE NO_MD5. There are other features that are default disabled and need to be specifically turned on with HAVE_<FEATURE> or WOLFSSL_<FEATURE> for example HAVE_ECC or WOLFSSL_SHA512. Chapter 2 of the wolfSSL manual goes over these in detail, here is a link: https://www.wolfssl.com/documentation/w … Manual.pdf

Please see 2.4.4 Enabling Features Disabled by Default.

Warm Regards,

K