|
| 1 | +# wolfSSL STM32MP25 |
| 2 | + |
| 3 | +The board will boot in Linux as default when you put in the supplied SD card. If you plug in an Ethernet cable, it will get a DHCP and you can ssh as `root` with no password. |
| 4 | + |
| 5 | +These instructions discuss how to cross-compile for the STM32MP25 when it is running OpenSTLinux. |
| 6 | + |
| 7 | +## SDK |
| 8 | + |
| 9 | +You can download the OpenSTLinux compiler / SDK from here: |
| 10 | + |
| 11 | +https://www.st.com/en/embedded-software/stm32mp2dev.html#get-software |
| 12 | + |
| 13 | +Note that the x86 package is a gzip of a `.tar.gz`. |
| 14 | + |
| 15 | +Once extracted, run the `.sh` file as root, it will install in `/opt/st`. |
| 16 | + |
| 17 | +## Compiling wolfSSL for ARM ASM |
| 18 | + |
| 19 | +The following sets up the build environment (CC, CFLAGS, etc...): |
| 20 | + |
| 21 | +```sh |
| 22 | +source /opt/st/stm32mp2/5.0.3-openstlinux-6.6-yocto-scarthgap-mpu-v24.11.06/environment-setup-cortexa35-ostl-linux |
| 23 | +``` |
| 24 | + |
| 25 | +Then this configure command will enable support for the ARM optimized assembly: |
| 26 | + |
| 27 | +```sh |
| 28 | +./configure --host=aarch64-linux-gnueabi --enable-sp-asm --enable-armasm --enable-all-asm |
| 29 | +``` |
| 30 | + |
| 31 | +## Compiling wolfSSL for cryptodev |
| 32 | + |
| 33 | +As before, setup build environment: |
| 34 | + |
| 35 | +```sh |
| 36 | +source /opt/st/stm32mp2/5.0.3-openstlinux-6.6-yocto-scarthgap-mpu-v24.11.06/environment-setup-cortexa35-ostl-linux |
| 37 | +``` |
| 38 | + |
| 39 | +The include path for cryptodev doesn't get added automatically, so this needs adding manually: |
| 40 | + |
| 41 | +```sh |
| 42 | +export CFLAGS="$CFLAGS -I /opt/st/stm32mp2/5.0.3-openstlinux-6.6-yocto-scarthgap-mpu-v24.11.06/sysroots/cortexa35-ostl-linux/usr/src/debug/cryptodev-module/1.13+git/" |
| 43 | +``` |
| 44 | + |
| 45 | +Then configure: |
| 46 | + |
| 47 | +```sh |
| 48 | +./configure --host=aarch64-linux-gnueabi --enable-sp-asm --enable-devcrypto |
| 49 | +``` |
| 50 | + |
| 51 | +On the STM32, run `modprobe cryptodev` before executing. |
| 52 | + |
| 53 | +## Benchmarks |
| 54 | + |
| 55 | +### Software |
| 56 | + |
| 57 | +``` |
| 58 | +------------------------------------------------------------------------------ |
| 59 | + wolfSSL version 5.7.6 |
| 60 | +------------------------------------------------------------------------------ |
| 61 | +Math: Multi-Precision: Wolf(SP) word-size=64 bits=4096 sp_int.c |
| 62 | + Single Precision: ecc 256 384 521 rsa/dh 2048 3072 4096 asm sp_arm64.c |
| 63 | +wolfCrypt Benchmark (block bytes 1048576, min 1.0 sec each) |
| 64 | +RNG 20 MiB took 1.272 seconds, 15.718 MiB/s |
| 65 | +AES-128-CBC-enc 30 MiB took 1.043 seconds, 28.760 MiB/s |
| 66 | +AES-128-CBC-dec 30 MiB took 1.032 seconds, 29.078 MiB/s |
| 67 | +AES-192-CBC-enc 25 MiB took 1.011 seconds, 24.740 MiB/s |
| 68 | +AES-192-CBC-dec 30 MiB took 1.194 seconds, 25.130 MiB/s |
| 69 | +AES-256-CBC-enc 25 MiB took 1.151 seconds, 21.730 MiB/s |
| 70 | +AES-256-CBC-dec 25 MiB took 1.131 seconds, 22.110 MiB/s |
| 71 | +AES-128-GCM-enc 20 MiB took 1.167 seconds, 17.132 MiB/s |
| 72 | +AES-128-GCM-dec 20 MiB took 1.167 seconds, 17.137 MiB/s |
| 73 | +AES-192-GCM-enc 20 MiB took 1.277 seconds, 15.662 MiB/s |
| 74 | +AES-192-GCM-dec 20 MiB took 1.277 seconds, 15.659 MiB/s |
| 75 | +AES-256-GCM-enc 15 MiB took 1.039 seconds, 14.439 MiB/s |
| 76 | +AES-256-GCM-dec 15 MiB took 1.039 seconds, 14.439 MiB/s |
| 77 | +GMAC Table 4-bit 42 MiB took 1.003 seconds, 41.876 MiB/s |
| 78 | +CHACHA 130 MiB took 1.015 seconds, 128.047 MiB/s |
| 79 | +CHA-POLY 95 MiB took 1.013 seconds, 93.815 MiB/s |
| 80 | +MD5 130 MiB took 1.013 seconds, 128.367 MiB/s |
| 81 | +POLY1305 355 MiB took 1.011 seconds, 351.276 MiB/s |
| 82 | +SHA 80 MiB took 1.044 seconds, 76.622 MiB/s |
| 83 | +SHA-224 40 MiB took 1.130 seconds, 35.390 MiB/s |
| 84 | +SHA-256 40 MiB took 1.130 seconds, 35.406 MiB/s |
| 85 | +SHA-384 65 MiB took 1.032 seconds, 62.985 MiB/s |
| 86 | +SHA-512 65 MiB took 1.032 seconds, 63.008 MiB/s |
| 87 | +SHA-512/224 65 MiB took 1.032 seconds, 62.995 MiB/s |
| 88 | +SHA-512/256 65 MiB took 1.032 seconds, 63.007 MiB/s |
| 89 | +SHA3-224 55 MiB took 1.025 seconds, 53.643 MiB/s |
| 90 | +SHA3-256 55 MiB took 1.074 seconds, 51.195 MiB/s |
| 91 | +SHA3-384 45 MiB took 1.122 seconds, 40.122 MiB/s |
| 92 | +SHA3-512 30 MiB took 1.053 seconds, 28.493 MiB/s |
| 93 | +HMAC-MD5 130 MiB took 1.018 seconds, 127.760 MiB/s |
| 94 | +HMAC-SHA 80 MiB took 1.044 seconds, 76.632 MiB/s |
| 95 | +HMAC-SHA224 40 MiB took 1.130 seconds, 35.392 MiB/s |
| 96 | +HMAC-SHA256 40 MiB took 1.130 seconds, 35.407 MiB/s |
| 97 | +HMAC-SHA384 65 MiB took 1.036 seconds, 62.720 MiB/s |
| 98 | +HMAC-SHA512 65 MiB took 1.032 seconds, 62.996 MiB/s |
| 99 | +PBKDF2 4 KiB took 1.002 seconds, 4.242 KiB/s |
| 100 | +RSA 2048 public 3900 ops took 1.012 sec, avg 0.259 ms, 3855.639 ops/sec |
| 101 | +RSA 2048 private 200 ops took 1.720 sec, avg 8.598 ms, 116.307 ops/sec |
| 102 | +DH 2048 key gen 226 ops took 1.001 sec, avg 4.431 ms, 225.666 ops/sec |
| 103 | +DH 2048 agree 300 ops took 1.328 sec, avg 4.427 ms, 225.890 ops/sec |
| 104 | +ECC [ SECP256R1] 256 key gen 6800 ops took 1.000 sec, avg 0.147 ms, 6797.480 ops/sec |
| 105 | +ECDHE [ SECP256R1] 256 agree 1900 ops took 1.018 sec, avg 0.536 ms, 1867.187 ops/sec |
| 106 | +ECDSA [ SECP256R1] 256 sign 4700 ops took 1.018 sec, avg 0.217 ms, 4615.200 ops/sec |
| 107 | +ECDSA [ SECP256R1] 256 verify 1800 ops took 1.028 sec, avg 0.571 ms, 1750.500 ops/sec |
| 108 | +Benchmark complete |
| 109 | +``` |
| 110 | + |
| 111 | +### Hardware (devcrypto) |
| 112 | + |
| 113 | +``` |
| 114 | +------------------------------------------------------------------------------ |
| 115 | + wolfSSL version 5.7.6 |
| 116 | +------------------------------------------------------------------------------ |
| 117 | +Math: Multi-Precision: Wolf(SP) word-size=64 bits=4096 sp_int.c |
| 118 | + Single Precision: ecc 256 384 521 rsa/dh 2048 3072 4096 asm sp_arm64.c |
| 119 | +wolfCrypt Benchmark (block bytes 1048576, min 1.0 sec each) |
| 120 | +RNG 5 MiB took 6.168 seconds, 0.811 MiB/s |
| 121 | +AES-128-CBC-enc 75 MiB took 1.053 seconds, 71.205 MiB/s |
| 122 | +AES-128-CBC-dec 75 MiB took 1.055 seconds, 71.063 MiB/s |
| 123 | +AES-192-CBC-enc 75 MiB took 1.051 seconds, 71.370 MiB/s |
| 124 | +AES-192-CBC-dec 75 MiB took 1.050 seconds, 71.405 MiB/s |
| 125 | +AES-256-CBC-enc 75 MiB took 1.049 seconds, 71.472 MiB/s |
| 126 | +AES-256-CBC-dec 75 MiB took 1.051 seconds, 71.332 MiB/s |
| 127 | +AES-128-GCM-enc 10 MiB took 1.828 seconds, 5.469 MiB/s |
| 128 | +AES-128-GCM-dec 10 MiB took 1.829 seconds, 5.468 MiB/s |
| 129 | +AES-192-GCM-enc 10 MiB took 1.828 seconds, 5.470 MiB/s |
| 130 | +AES-192-GCM-dec 10 MiB took 1.829 seconds, 5.468 MiB/s |
| 131 | +AES-256-GCM-enc 10 MiB took 1.827 seconds, 5.475 MiB/s |
| 132 | +AES-256-GCM-dec 10 MiB took 1.829 seconds, 5.468 MiB/s |
| 133 | +GMAC Table 4-bit 44 MiB took 1.000 seconds, 43.707 MiB/s |
| 134 | +CHACHA 75 MiB took 1.051 seconds, 71.348 MiB/s |
| 135 | +CHA-POLY 55 MiB took 1.035 seconds, 53.139 MiB/s |
| 136 | +MD5 135 MiB took 1.016 seconds, 132.876 MiB/s |
| 137 | +POLY1305 225 MiB took 1.010 seconds, 222.817 MiB/s |
| 138 | +SHA 85 MiB took 1.019 seconds, 83.452 MiB/s |
| 139 | +SHA-256 40 MiB took 1.108 seconds, 36.086 MiB/s |
| 140 | +SHA-384 65 MiB took 1.011 seconds, 64.305 MiB/s |
| 141 | +SHA-512 65 MiB took 1.011 seconds, 64.282 MiB/s |
| 142 | +SHA-512/224 65 MiB took 1.011 seconds, 64.317 MiB/s |
| 143 | +SHA-512/256 65 MiB took 1.013 seconds, 64.193 MiB/s |
| 144 | +SHA3-224 50 MiB took 1.065 seconds, 46.929 MiB/s |
| 145 | +SHA3-256 45 MiB took 1.014 seconds, 44.375 MiB/s |
| 146 | +SHA3-384 35 MiB took 1.023 seconds, 34.225 MiB/s |
| 147 | +SHA3-512 25 MiB took 1.051 seconds, 23.782 MiB/s |
| 148 | +HMAC-MD5 135 MiB took 1.011 seconds, 133.567 MiB/s |
| 149 | +HMAC-SHA 85 MiB took 1.017 seconds, 83.575 MiB/s |
| 150 | +HMAC-SHA256 40 MiB took 1.085 seconds, 36.882 MiB/s |
| 151 | +HMAC-SHA384 65 MiB took 1.014 seconds, 64.118 MiB/s |
| 152 | +HMAC-SHA512 65 MiB took 1.009 seconds, 64.413 MiB/s |
| 153 | +PBKDF2 576 bytes took 1.003 seconds, 574.070 bytes/s |
| 154 | +RSA 2048 public 1800 ops took 1.058 sec, avg 0.588 ms, 1701.863 ops/sec |
| 155 | +RSA 2048 private 200 ops took 1.721 sec, avg 8.604 ms, 116.218 ops/sec |
| 156 | +DH 2048 key gen 222 ops took 1.003 sec, avg 4.517 ms, 221.370 ops/sec |
| 157 | +DH 2048 agree 300 ops took 1.326 sec, avg 4.422 ms, 226.160 ops/sec |
| 158 | +ECC [ SECP256R1] 256 key gen 4400 ops took 1.000 sec, avg 0.227 ms, 4398.670 ops/sec |
| 159 | +ECDHE [ SECP256R1] 256 agree 1900 ops took 1.018 sec, avg 0.536 ms, 1866.172 ops/sec |
| 160 | +ECDSA [ SECP256R1] 256 sign 3400 ops took 1.017 sec, avg 0.299 ms, 3344.432 ops/sec |
| 161 | +ECDSA [ SECP256R1] 256 verify 1800 ops took 1.027 sec, avg 0.571 ms, 1752.662 ops/sec |
| 162 | +Benchmark complete |
| 163 | +``` |
| 164 | + |
0 commit comments