We would like to announce that the wolfSSL embedded SSL library now has support for hardware-based cryptography and random number generation offered by the STM32F7. Supported cryptographic algorithms include AES (CBC, CTR), DES (ECB, CBC), 3DES, MD5, and SHA1. For details regarding the STM32F7 crypto and hash processors, please see the STM32F7 Hardware Abstraction Layer (HAL) and Low-layer drivers document (linked below).
If you are using the STM32F7 with wolfSSL, you can see substantial speed improvements when using the hardware crypto versus using wolfSSL’s software crypto implementation. The following benchmarks were gathered from the wolfCrypt benchmark application (wolfcrypt/benchmark/benchmark.c) running on the STM32F777NI board (STM32F7) using the STM32F7 HAL on bare metal (No OS).
wolfSSL Software Crypto, Normal Big Integer Math Library
RNG 3 MB took 1.000 seconds, 3.149 MB/s
AES-Enc 6 MB took 1.000 seconds, 6.494 MB/s
AES-Dec 7 MB took 1.000 seconds, 6.519 MB/s
AES-GCM-Enc 3 MB took 1.004 seconds, 2.553 MB/s
AES-GCM-Dec 3 MB took 1.004 seconds, 2.553 MB/s
AES-CTR 7 MB took 1.000 seconds, 6.543 MB/s
CHACHA 16 MB took 1.000 seconds, 15.723 MB/s
CHA-POLY 10 MB took 1.000 seconds, 10.474 MB/s
3DES 1 MB took 1.008 seconds, 1.405 MB/s
MD5 24 MB took 1.000 seconds, 24.243 MB/s
POLY1305 42 MB took 1.000 seconds, 41.821 MB/s
SHA 14 MB took 1.000 seconds, 14.380 MB/s
SHA-224 8 MB took 1.000 seconds, 8.423 MB/s
SHA-256 8 MB took 1.000 seconds, 8.423 MB/s
SHA-384 2 MB took 1.000 seconds, 2.319 MB/s
SHA-512 2 MB took 1.000 seconds, 2.319 MB/s
STM32F7 Hardware Crypto, Normal Big Integer Math Library
RNG 6 MB took 1.000 seconds, 6.030 MB/s
AES-Enc 30 MB took 1.000 seconds, 30.396 MB/s
AES-Dec 30 MB took 1.000 seconds, 30.371 MB/s
AES-GCM-Enc 42 MB took 1.000 seconds, 42.261 MB/s
AES-GCM-Dec 33 MB took 1.000 seconds, 32.861 MB/s
AES-CTR 48 MB took 1.000 seconds, 47.827 MB/s
CHACHA 16 MB took 1.000 seconds, 15.747 MB/s
CHA-POLY 11 MB took 1.000 seconds, 10.522 MB/s
3DES 13 MB took 1.000 seconds, 12.988 MB/s
MD5 41 MB took 1.000 seconds, 40.894 MB/s
POLY1305 42 MB took 1.000 seconds, 41.846 MB/s
SHA 38 MB took 1.004 seconds, 38.202 MB/s
SHA-224 41 MB took 1.000 seconds, 41.309 MB/s
SHA-256 39 MB took 1.000 seconds, 39.111 MB/s
SHA-384 2 MB took 1.004 seconds, 2.310 MB/s
SHA-512 2 MB took 1.004 seconds, 2.310 MB/s
As the above benchmarks (and chart) show, the hardware-based algorithms on the STM32F7 demonstrate significantly faster speeds than that of their software counterparts.
To enable STM32F7 hardware crypto and RNG support, define WOLFSSL_STM32F7 when building wolfSSL. For a more complete list of defines which may be required, please see the WOLFSSL_STM32F7 define in <wolfssl_root>/wolfssl/wolfcrypt/settings.h. You can find the most recent version of wolfSSL on GitHub, here: https://github.com/wolfssl/wolfssl.
If you would like to use wolfSSL with STM32F7 hardware-based cryptography or RNG, or have any questions, please contact us at facts@wolfssl.com for more information.
STM32: http://www.st.com/internet/mcu/class/1734.jsp
STM32F7 HAL and Low-layer drivers documentation: http://www.st.com/content/ccc/resource/technical/document/user_manual/45/27/9c/32/76/57/48/b9/DM00189702.pdf/files/DM00189702.pdf/jcr:content/translations/en.DM00189702.pdf