1 (edited by mahdyseifelnasr 2021-03-25 10:32:05)

Topic: running wolfssl benchmark on ARM-Cortex M0

Hello,

I am new in cryptography and I do not have much experience with microcontrollers.

I want to compile wolfssl library and use on ARM cortex M0. Later, I want to run wolfssl benchmark on the ARM cortex M0.

My developing environment is arm gcc as cross platform compiler, make for building and linking the project and openOCD as debugger. I can switch to CubeMX IDE if it will the development process easier. 


Can anyone help me how to compile and use wolfssl on ARM Cortex-M0 ?

Share

Re: running wolfssl benchmark on ARM-Cortex M0

Hi mahdyseifelnasr,

We fully support the CortexM0 with some impressive assembly speedups for ECC, RSA and DH.

There is a good Makefile template for GCC ARM here:
https://github.com/wolfSSL/wolfssl/tree … DE/GCC-ARM

If you would prefer to cross-compile using ./configure here is an example:
./configure --host=arm-none-eabi CC=gcc AR=ar --disable-shared --enable-cryptonly --disable-examples --disable-crypttests --prefix=[yourpath]

If you have the option to use the STM32Cube wolfSSL pack it allows you to generate code on many STM32 targets and IDE's.

Thanks,
David Garske, wolfSSL

Share

3 (edited by yusheng 2023-01-23 14:56:13)

Re: running wolfssl benchmark on ARM-Cortex M0

Hi David,

I think the original question was more about how to run a cross-compiled benchmark, not about how to cross-compile wolfSSL in general.

Does benchmark support cross-compiling? Looking at https://github.com/wolfSSL/wolfssl/tree … /benchmark , I don't see an example of a cross-compiled output.

I've built wolfSSL 4.7.0 for ARM v8 Zynq UltraScale+ QNX 7.1 using "./configure --enable-benchmark --enable-smime --enable-opensslall --enable-opensslextra --enable-crl --enable-certgen --enable-des3 --enable-reproducible-build --enable-harden --enable-static --build=x86_64-linux-gnu --host=aarch64-qnx" and with the environment variables CC="qcc"
CFLAGS="-DWOLFSSL_PSS_SALT_LEN_DISCOVER -DWOLFSSL_HAVE_MIN -DWOLFSSL_HAVE_MAX".

With this build, I can successfully run wolfssl-config on my QNX target. But when I try to run benchmark on my QNX target, I get this:

wolfcrypt/benchmark/benchmark: qcc: cannot execute - No such file or directory

which makes sense because qcc is not expected to be on the target...only on the host. This seems to be happening at the "# relink executable if necessary" step.

So then, I tried running benchmark on the host. It showed this output:

wolfcrypt/benchmark/benchmark: wolfcrypt/benchmark/.libs/lt-benchmark: /usr/lib/ldqnx-64.so.2: bad ELF interpreter: No such file or directory
wolfcrypt/benchmark/benchmark: line 117: wolfcrypt/benchmark/.libs/lt-benchmark: Success

Then, I tried running benchmark on the target again, thinking that it made it past the "relink executable if necessary" step. It showed this output:

wolfcrypt/benchmark/.libs/lt-benchmark[178]: no closing quote

Any ideas?

Thanks,
Yusheng

Share

Re: running wolfssl benchmark on ARM-Cortex M0

Hi Yusheng,

Here is an example for how I've built wolfSSL for QNX in the past:

./configure --host=aarch64 CC="aarch64-unknown-nto-qnx7.0.0-gcc" AR="aarch64-unknown-nto-qnx7.0.0-ar" RANLIB="aarch64-unknown-nto-qnx7.0.0-ranlib" --disable-examples CFLAGS="-DWOLFSSL_HAVE_MIN -DWOLFSSL_HAVE_MAX -DFP_MAX_BITS=8192"

You might consider adding `--disable-shared` so it is built statically. Then you can copy wolfcrypt/benchmark/benchmark to the target and run it.

Thanks,
David Garske, wolfSSL

Share