Topic: Is it possible to build the wolfCrypt library on it's own?

I am working on a deeply embedded application using a RISC-V core (specifically rv32im/ilp32 -- this is a 32-bit, 32-register core with integer multiply / divide). I don't need SSL, I just need wolfCrypt.

I looked through wolfSSL User Manual / August 2019 / Version 4.1.0, which I believe to be the latest version and didn't see anything  specific about building wolfCrypt.

I probably missed it, but if you could hint me in the right direction, that would be most appreciated.

ACV

Share

Re: Is it possible to build the wolfCrypt library on it's own?

Hi ACV,

Have you seen our RISC-V examples here? https://github.com/wolfSSL/wolfssl/tree … /IDE/RISCV

To build wolfCrypt only you can define `WOLFCRYPT_ONLY` and compile the source files in wolfcrypt/src/*.c that are applicable. If you are not cross-compiling with ./configure I would recommend defining CFLAG -DWOLFSSL_USER_SETTINGS and adding your own `user_settings.h` file. Your include path needs to be in the wolfssl root. Then in your application make sure you include wolfssl/wolfcrypt/settings.h prior to any other wolfSSL headers.

We have some user_settings.h examples here:
https://github.com/wolfSSL/wolfssl/tree … es/configs

This is also covered in the FAQ here:
https://www.wolfssl.com/docs/frequently … r_wolfSSL?

Let us know if you have any issues.

Thanks,
David Garske, wolfSSL

Share

Re: Is it possible to build the wolfCrypt library on it's own?

We are developing a RISC-V rv32im / ilp32 core. Eventually it will support the atomic and compressed instructions. However at this point it does not. For reasons beyond this discussion, that means that the autoconf build isn't going to work for me right now. This leaves me with the second build option WOLF_USER_SETTINGS. I am able to build the library using this method.

I looked at the .../IDE/RISCV settings. This directory should be called .../IDE/SIFIVE-RISCV. The defines in the HIFIVE directory are specific to the the E310 (rv32imac). Unfortunately this won't work for my project. Ideally I would be able to select the RISCV core configuration and wouldn't be tied to a specific vendor / chip.

I looked at the examples/configs. The closest thing is the stm32. However there is quite a bit of STM32Fxxx / Cube specifics. Ideally there would be a 32-bit / little endian / hardware multiplier / XMALLOC example that I could build on.

Is there a generic 32-bit / little endian / hardware multiplier / XMALLOC example that doesn't have any processor specifics in it?

Is there a "configuration guide" that goes through the settings and describes what they do and why I might need them?

Share

Re: Is it possible to build the wolfCrypt library on it's own?

Hi ACV,

Thanks for those details and I agree the RISC-V stuff there is very SiFive specific.

My best pointer is the user_settings_template.h file here: https://github.com/wolfSSL/wolfssl/blob … template.h
It explains each build option.

Let me know if you need details on any specific build options. Many of these are covered in the user manual chapter 2. https://www.wolfssl.com/docs/wolfssl-manual/ch2/

Thanks,
David Garske, wolfSSL

Share