Topic: Undefined reference to wc_ChaCha20Poly1305_Encrypt

Hi all,

Sorry if this is a silly question, I’m new to wolfSSL (and honestly using libraries with C in general— more of a Python kinda guy). I’m working on a project with an embedded system and am using WolfSSL as our cryptography library.

Right now, we have some basic functionality set up such as SHA256 hashing and AES CBC encrypting and decrypting. I’m looking to migrate from AES CBC to ChaCha20-Poly1305 to help provide integrity/authenticity along with confidentiality of messages sent over the wire. I thought it would be a simple

#include “chacha20_poly1305.h”

But it’s proving to be tricky for me. I’m getting wc_ChaCha20Poly1305_Encrypt is undefined and not sure why. I set up wolfSSL with the default configuration, and from my reading ChaCha20 and Poly1305 should be enabled by default. My linking of the library should be fine considering my AES, SHA, and RNG functions are working fine. Is there some other flag I have to set when configuring WolfSSL to get ChaCha20-Poly1305 support?

Thanks in advance,

Landon

Share

Re: Undefined reference to wc_ChaCha20Poly1305_Encrypt

Copying from zendesk ticket:

When including wolfSSL headers in your application, you must include our build settings (options.h/settings.h) first as follows:

#include <wolfssl/options.h>
#include <wolfssl/wolfcrypt/settings.h>

You need to include these headers before all other wolf/OpenSSL headers in all files which include these headers.  Please give it a try and let me know if it helps.

Share