Cryptographic performance on STM32WB Series V5.x

This page reports measured performance when using the pure software cryptographic library algorithms with an STM32WB MCU. In addition to performance figures, the required code footprint and memory are also given.


1. Measurement configuration

1.1. Hardware configuration

STM32 MCU STM32WB55RG
Device ID 0x495
Revision ID 0x2001
Board P-NUCLEO-WB55

1.2. Firmware configuration

Cryptographic library version 050000B2[ver. 1]
  1. This value corresponds to the information returned by a call to cmox_getInfos

1.3. System configuration

System core clock frequency 64 MHz
Flash latency 3 wait states
Voltage scaling Range 1
Instruction cache (ART/ICU) 1 (0: disabled / 1: enabled)
Data cache (ART/DCU) 1 (0: disabled / 1: enabled)
Prefetch cache (ART) 1 (0: disabled / 1: enabled)

1.4. Development toolchains and compilers

IAR Embedded Workbench IAR ANSI C/C++ Compiler V9.40.1.364/W64 for ARM
Information
The measurements are done using a project built with the High Speed optimization setting enabled.


2. Performance values

2.1. AES symmetric key encryption and decryption

This section provides the performance results for AES-CBC using different operation modes:

  • Sole buffer: one sole buffer is encrypted or decrypted. The performance time is given in µs.
  • Data flow: a big message is encrypted or decrypted in chunks. The bit rate is given in kilobytes per second.

2.1.1. Sole buffer mode

In this mode, the entire encryption or decryption process, for the full message size, is managed through a single API call provided by the CMOX library.

The table below shows the number of clock cycles and time (in µs) needed to perform the described operation in small and fast configurations.

AES mode Key size Buffer size Cipher operation Configuration Cycles Time
AES CBC 128 bits 32 bytes Encryption Small 4037 63 µs
AES CBC 128 bits 32 bytes Encryption Fast 4215 65 µs
AES CBC 128 bits 64 bytes Encryption Small 6602 103 µs
AES CBC 128 bits 64 bytes Encryption Fast 7063 110 µs
AES CBC 128 bits 128 bytes Encryption Small 11 835 184 µs
AES CBC 128 bits 128 bytes Encryption Fast 12 734 198 µs
AES CBC 192 bits 32 bytes Encryption Small 4332 67 µs
AES CBC 192 bits 32 bytes Encryption Fast 4566 71 µs
AES CBC 192 bits 64 bytes Encryption Small 7235 113 µs
AES CBC 192 bits 64 bytes Encryption Fast 7829 122 µs
AES CBC 192 bits 128 bytes Encryption Small 13 265 207 µs
AES CBC 192 bits 128 bytes Encryption Fast 14 323 223 µs
AES CBC 256 bits 32 bytes Encryption Small 4898 76 µs
AES CBC 256 bits 32 bytes Encryption Fast 5206 81 µs
AES CBC 256 bits 64 bytes Encryption Small 8300 129 µs
AES CBC 256 bits 64 bytes Encryption Fast 8885 138 µs
AES CBC 256 bits 128 bytes Encryption Small 14 872 232 µs
AES CBC 256 bits 128 bytes Encryption Fast 16 166 252 µs
AES CBC 128 bits 32 bytes Decryption Small 4925 76 µs
AES CBC 128 bits 32 bytes Decryption Fast 5917 92 µs
AES CBC 128 bits 64 bytes Decryption Small 8474 132 µs
AES CBC 128 bits 64 bytes Decryption Fast 8764 136 µs
AES CBC 128 bits 128 bytes Decryption Small 15 706 245 µs
AES CBC 128 bits 128 bytes Decryption Fast 14 460 225 µs
AES CBC 192 bits 32 bytes Decryption Small 5461 85 µs
AES CBC 192 bits 32 bytes Decryption Fast 6637 103 µs
AES CBC 192 bits 64 bytes Decryption Small 9536 149 µs
AES CBC 192 bits 64 bytes Decryption Fast 9900 154 µs
AES CBC 192 bits 128 bytes Decryption Small 17 719 276 µs
AES CBC 192 bits 128 bytes Decryption Fast 16 382 255 µs
AES CBC 256 bits 32 bytes Decryption Small 6213 97 µs
AES CBC 256 bits 32 bytes Decryption Fast 7616 119 µs
AES CBC 256 bits 64 bytes Decryption Small 10 884 170 µs
AES CBC 256 bits 64 bytes Decryption Fast 11 295 176 µs
AES CBC 256 bits 128 bytes Decryption Small 20 204 315 µs
AES CBC 256 bits 128 bytes Decryption Fast 18 628 291 µs


The table below shows flash memory and RAM usage (in bytes).

Cipher operation Configuration Code Constant data Global data Stack usage
Encryption Small 2302 bytes 324 bytes 0 bytes 552 bytes
Encryption Fast 2246 bytes 1092 bytes 0 bytes 552 bytes
Decryption Small 2650 bytes 580 bytes 0 bytes 568 bytes
Decryption Fast 2600 bytes 2372 bytes 0 bytes 568 bytes


2.1.2. Data flow mode

In this mode, the operation is performed in several calls to the CMOX library APIs, as shown below:

  • cmox_cipher_init
  • cmox_cipher_setKey
  • cmox_cipher_setIV
  • cmox_cipher_append: called several times to encrypt or decrypt the whole message in fixed-size chunks

The table below shows the number of clock cycles and the bit rate (in kilobytes per second) needed to perform the described operation in small and fast configuration.

AES mode Key size Message size Chunk size Cipher operation Configuration Cycles Bit rate
AES CBC 128 bits 8000 bytes 128 bytes Encryption Small 662 608 772 Kbytes/s
AES CBC 128 bits 8000 bytes 128 bytes Encryption Fast 718 536 712 Kbytes/s
AES CBC 128 bits 8000 bytes 512 bytes Encryption Small 653 952 782 Kbytes/s
AES CBC 128 bits 8000 bytes 512 bytes Encryption Fast 710 264 720 Kbytes/s
AES CBC 128 bits 8000 bytes 1024 bytes Encryption Small 652 320 784 Kbytes/s
AES CBC 128 bits 8000 bytes 1024 bytes Encryption Fast 708 840 722 Kbytes/s
AES CBC 128 bits 8000 bytes 2048 bytes Encryption Small 652 576 784 Kbytes/s
AES CBC 128 bits 8000 bytes 2048 bytes Encryption Fast 708 128 723 Kbytes/s
AES CBC 192 bits 8000 bytes 128 bytes Encryption Small 751 568 681 Kbytes/s
AES CBC 192 bits 8000 bytes 128 bytes Encryption Fast 821 048 623 Kbytes/s
AES CBC 192 bits 8000 bytes 512 bytes Encryption Small 740 960 690 Kbytes/s
AES CBC 192 bits 8000 bytes 512 bytes Encryption Fast 810 832 631 Kbytes/s
AES CBC 192 bits 8000 bytes 1024 bytes Encryption Small 737 736 694 Kbytes/s
AES CBC 192 bits 8000 bytes 1024 bytes Encryption Fast 809 736 632 Kbytes/s
AES CBC 192 bits 8000 bytes 2048 bytes Encryption Small 738 128 693 Kbytes/s
AES CBC 192 bits 8000 bytes 2048 bytes Encryption Fast 809 320 632 Kbytes/s
AES CBC 256 bits 8000 bytes 128 bytes Encryption Small 851 016 601 Kbytes/s
AES CBC 256 bits 8000 bytes 128 bytes Encryption Fast 927 952 551 Kbytes/s
AES CBC 256 bits 8000 bytes 512 bytes Encryption Small 842 384 607 Kbytes/s
AES CBC 256 bits 8000 bytes 512 bytes Encryption Fast 919 648 556 Kbytes/s
AES CBC 256 bits 8000 bytes 1024 bytes Encryption Small 839 680 609 Kbytes/s
AES CBC 256 bits 8000 bytes 1024 bytes Encryption Fast 918 272 557 Kbytes/s
AES CBC 256 bits 8000 bytes 2048 bytes Encryption Small 839 376 609 Kbytes/s
AES CBC 256 bits 8000 bytes 2048 bytes Encryption Fast 917 584 557 Kbytes/s
AES CBC 128 bits 8000 bytes 128 bytes Decryption Small 924 336 553 Kbytes/s
AES CBC 128 bits 8000 bytes 128 bytes Decryption Fast 742 512 689 Kbytes/s
AES CBC 128 bits 8000 bytes 512 bytes Decryption Small 900 912 568 Kbytes/s
AES CBC 128 bits 8000 bytes 512 bytes Decryption Fast 727 752 703 Kbytes/s
AES CBC 128 bits 8000 bytes 1024 bytes Decryption Small 895 408 571 Kbytes/s
AES CBC 128 bits 8000 bytes 1024 bytes Decryption Fast 723 984 707 Kbytes/s
AES CBC 128 bits 8000 bytes 2048 bytes Decryption Small 890 504 574 Kbytes/s
AES CBC 128 bits 8000 bytes 2048 bytes Decryption Fast 720 112 711 Kbytes/s
AES CBC 192 bits 8000 bytes 128 bytes Decryption Small 1 052 672 486 Kbytes/s
AES CBC 192 bits 8000 bytes 128 bytes Decryption Fast 849 520 602 Kbytes/s
AES CBC 192 bits 8000 bytes 512 bytes Decryption Small 1 033 896 495 Kbytes/s
AES CBC 192 bits 8000 bytes 512 bytes Decryption Fast 834 496 613 Kbytes/s
AES CBC 192 bits 8000 bytes 1024 bytes Decryption Small 1 029 408 497 Kbytes/s
AES CBC 192 bits 8000 bytes 1024 bytes Decryption Fast 830 944 616 Kbytes/s
AES CBC 192 bits 8000 bytes 2048 bytes Decryption Small 1 024 312 499 Kbytes/s
AES CBC 192 bits 8000 bytes 2048 bytes Decryption Fast 826 616 619 Kbytes/s
AES CBC 256 bits 8000 bytes 128 bytes Decryption Small 1 198 784 427 Kbytes/s
AES CBC 256 bits 8000 bytes 128 bytes Decryption Fast 950 784 538 Kbytes/s
AES CBC 256 bits 8000 bytes 512 bytes Decryption Small 1 177 960 434 Kbytes/s
AES CBC 256 bits 8000 bytes 512 bytes Decryption Fast 936 520 546 Kbytes/s
AES CBC 256 bits 8000 bytes 1024 bytes Decryption Small 1 171 624 437 Kbytes/s
AES CBC 256 bits 8000 bytes 1024 bytes Decryption Fast 932 912 548 Kbytes/s
AES CBC 256 bits 8000 bytes 2048 bytes Decryption Small 1 167 024 438 Kbytes/s
AES CBC 256 bits 8000 bytes 2048 bytes Decryption Fast 929 128 551 Kbytes/s


The table below shows flash memory and RAM usage (in bytes).

Cipher operation Configuration Code Constant data Global data Stack usage
Encryption Small 2222 bytes 316 bytes 0 bytes 176 bytes
Encryption Fast 2166 bytes 1084 bytes 0 bytes 176 bytes
Decryption Small 2570 bytes 572 bytes 0 bytes 192 bytes
Decryption Fast 2520 bytes 2364 bytes 0 bytes 192 bytes


2.2. HASH digest

In this section we provide the performance results for HASH, using different modes of operation:

  • Sole buffer: one sole buffer is hashed. The performance time is given in us.
  • Data flow: a big message is hashed in chunks. The bit rate is given in bytes per second.

2.2.1. Sole buffer mode

In this mode, the entire message hashing process is managed through a single API call provided by the CMOX library.

The table below shows the number of clock cycles and time (in µs) needed to perform the described operation.

HASH mode Buffer size Cycles Time
SHA256 32 bytes 4578 71 µs
SHA256 64 bytes 7797 121 µs
SHA256 128 bytes 10 834 169 µs
SHA384 32 bytes 18 050 282 µs
SHA384 64 bytes 18 268 285 µs
SHA384 128 bytes 34 727 542 µs


The table below shows flash memory and RAM usage (in bytes).

HASH mode Code Constant data Global data Stack usage
SHA256 1358 280 bytes 0 bytes 532 bytes
SHA384 2504 728 bytes 0 bytes 1076 bytes


2.2.2. Data flow mode

In this mode, the operation is performed in several calls to the CMOX library APIs, as shown below:

  • cmox_hash_init
  • cmox_hash_append: called several times to hash the whole message in fixed-size chunks
  • cmox_hash_generateTag

The table below shows the number of clock cycles and the bit rate (in kilobytes per second) needed to perform the described operation.

HASH mode Message size Chunk size Cycles Bit rate
SHA256 8000 bytes 128 bytes 412 647 1240 Kbytes/s
SHA256 8000 bytes 512 bytes 386 456 1324 Kbytes/s
SHA256 8000 bytes 1024 bytes 382 000 1340 Kbytes/s
SHA256 8000 bytes 2048 bytes 379 785 1348 Kbytes/s
SHA384 8000 bytes 128 bytes 1 056 806 484 Kbytes/s
SHA384 8000 bytes 512 bytes 1 009 466 507 Kbytes/s
SHA384 8000 bytes 1024 bytes 1 001 234 511 Kbytes/s
SHA384 8000 bytes 2048 bytes 997 118 513 Kbytes/s


The table below shows the final tag generation done through the call to cmox_hash_generateTag.

HASH mode Cycles Time
SHA256 3555 55 µs
SHA384 16 858 263 µs

The table below shows flash memory and RAM usage (in bytes).

HASH mode Code Constant data Global data Stack usage
SHA256 1354 bytes 272 bytes 0 bytes 340 bytes
SHA384 2500 bytes 720 bytes 0 bytes 780 bytes


2.3. ECDSA signature and verification

This section provides the performance results for ECDSA signature and verification.

The table below shows the number of clock cycles and time (in ms) needed to perform the described operation in different configurations.

Curve Operation ECC mathematics configuration Curve definition Cycles Time
SECP256R1 Signature Small Low 3 062 832 47 ms
SECP256R1 Signature Small High 2 968 008 46 ms
SECP256R1 Signature SuperFast Low 2 678 992 41 ms
SECP256R1 Signature SuperFast High 2 590 920 40 ms
SECP256R1 Verification Small Low 7 420 744 115 ms
SECP256R1 Verification Small High 6 574 648 102 ms
SECP256R1 Verification SuperFast Low 6 514 744 101 ms
SECP256R1 Verification SuperFast High 5 757 048 89 ms
SECP384R1 Signature Small Low 8 385 824 131 ms
SECP384R1 Signature Small High 8 022 144 125 ms
SECP384R1 Signature Fast Low 8 313 792 129 ms
SECP384R1 Signature Fast High 7 851 352 122 ms
SECP384R1 Verification Small Low 20 203 496 315 ms
SECP384R1 Verification Small High 17 546 184 274 ms
SECP384R1 Verification Fast Low 20 010 208 312 ms
SECP384R1 Verification Fast High 17 184 688 268 ms


The table below shows ECDSA flash memory and RAM usage (in bytes).

Note
The footpring is measured using the general-purpose CMOX_ECC_XXX_HIGHMEM or CMOX_ECC_XXX_LOWMEM configuration, which shows the footprint increase compared with the V4.x.x. To reduce the footprint, the optimized confinguration CMOX_ECC_XXX_YYY_SIGN or CMOX_ECC_XXX_YYY_VERIFY is recommended.
Curve Operation ECC mathematics configuration Curve definition Code Constant data Global data Stack usage Working buffer
SECP256R1 Signature Small Low 13 442 bytes 1212 bytes 0 bytes 440 bytes 628 bytes
SECP256R1 Signature Small High 13 442 bytes 1596 bytes 0 bytes 440 bytes 696 bytes
SECP256R1 Signature SuperFast Low 14 752 bytes 1212 bytes 0 bytes 444 bytes 628 bytes
SECP256R1 Signature SuperFast High 14 752 bytes 1596 bytes 0 bytes 444 bytes 696 bytes
SECP256R1 Verification Small Low 13 430 bytes 1212 bytes 0 bytes 488 bytes 856 bytes
SECP256R1 Verification Small High 13 430 bytes 1596 bytes 0 bytes 488 bytes 1648 bytes
SECP256R1 Verification SuperFast Low 14 740 bytes 1212 bytes 0 bytes 492 bytes 856 bytes
SECP256R1 Verification SuperFast High 14 740 bytes 1596 bytes 0 bytes 492 bytes 1648 bytes
SECP384R1 Signature Small Low 13 442 bytes 1692 bytes 0 bytes 440 bytes 884 bytes
SECP384R1 Signature Small High 13 442 bytes 2268 bytes 0 bytes 440 bytes 984 bytes
SECP384R1 Signature Fast Low 13 812 bytes 1692 bytes 0 bytes 456 bytes 884 bytes
SECP384R1 Signature Fast High 13 812 bytes 2268 bytes 0 bytes 456 bytes 984 bytes
SECP384R1 Verification Small Low 13 430 bytes 1692 bytes 0 bytes 488 bytes 1192 bytes
SECP384R1 Verification Small High 13 430 bytes 2268 bytes 0 bytes 488 bytes 2272 bytes
SECP384R1 Verification Fast Low 13 800 bytes 1692 bytes 0 bytes 504 bytes 1192 bytes
SECP384R1 Verification Fast High 13 800 bytes 2268 bytes 0 bytes 504 bytes 2272 bytes


2.4. EdDSA signature and verification

This section provides the performance results for EdDSA signature and verification.

The table below shows the number of clock cycles and time (in ms) needed to perform the described operation in different configurations.

Curve Message size Operation ECC mathematics configuration Curve definition Cycles Time
Ed25519 1023 bytes Signature Small OptLow 4 816 928 75 ms
Ed25519 1023 bytes Signature Small OptHigh 2 811 848 43 ms
Ed25519 1023 bytes Signature SuperFast OptLow 4 312 280 67 ms
Ed25519 1023 bytes Signature SuperFast OptHigh 2 538 808 39 ms
Ed25519 1023 bytes Verification Small OptLow 7 200 456 112 ms
Ed25519 1023 bytes Verification Small OptHigh 6 326 464 98 ms
Ed25519 1023 bytes Verification SuperFast OptLow 6 356 616 99 ms
Ed25519 1023 bytes Verification SuperFast OptHigh 5 594 648 87 ms


The table below shows EdDSA flash memory and RAM usage (in bytes).

Note
The footpring is measured using the general-purpose CMOX_ECC_XXX_HIGHMEM or CMOX_ECC_XXX_LOWMEM configuration, which shows the footprint increase compared with the V4.x.x. To reduce the footprint, the optimized confinguration CMOX_ECC_XXX_YYY_SIGN or CMOX_ECC_XXX_YYY_VERIFY is recommended.
Curve Message size Operation ECC mathematics configuration Curve definition Code Constant data Global data Stack usage Working buffer
Ed25519 1023 bytes Signature Small OptLow 14 752 bytes 1748 bytes 0 bytes 1172 bytes 1672 bytes
Ed25519 1023 bytes Signature Small OptHigh 15 172 bytes 2900 bytes 0 bytes 1172 bytes 1672 bytes
Ed25519 1023 bytes Signature SuperFast OptLow 16 062 bytes 1748 bytes 0 bytes 1172 bytes 1672 bytes
Ed25519 1023 bytes Signature SuperFast OptHigh 16 482 bytes 2900 bytes 0 bytes 1172 bytes 1672 bytes
Ed25519 1023 bytes Verification Small OptLow 14 748 bytes 1748 bytes 0 bytes 1172 bytes 984 bytes
Ed25519 1023 bytes Verification Small OptHigh 15 168 bytes 2900 bytes 0 bytes 1172 bytes 1992 bytes
Ed25519 1023 bytes Verification SuperFast OptLow 16 058 bytes 1748 bytes 0 bytes 1172 bytes 984 bytes
Ed25519 1023 bytes Verification SuperFast OptHigh 16 478 bytes 2900 bytes 0 bytes 1172 bytes 1992 bytes


2.5. RSA signature and verification

This section provides the performance results for RSA signature and verification.

The table below shows the number of clock cycles and time (in ms) needed to perform the described operation in different configurations.

PKCS#1 Priv. key mod. exp. method Hash method Modulus size Operation RSA mathematics configuration Priv. key mod. exp. implementation Cycles Time
v2.2 CRT SHA-256 3K Signature Small Low 187 628 064 2931 ms
v2.2 CRT SHA-256 3K Signature Small Mid 141 270 928 2207 ms
v2.2 CRT SHA-256 3K Signature Small High 118 648 904 1853 ms
v2.2 CRT SHA-256 3K Signature Fast Low 186 933 184 2920 ms
v2.2 CRT SHA-256 3K Signature Fast Mid 140 847 672 2200 ms
v2.2 CRT SHA-256 3K Signature Fast High 118 247 736 1847 ms
v2.2 No CRT SHA-256 3K Signature Small Low 713 486 472 11 148 ms
v2.2 No CRT SHA-256 3K Signature Small Mid 535 922 784 8373 ms
v2.2 No CRT SHA-256 3K Signature Small High 448 313 072 7004 ms
v2.2 No CRT SHA-256 3K Signature Fast Low 712 275 656 11 129 ms
v2.2 No CRT SHA-256 3K Signature Fast Mid 535 119 072 8361 ms
v2.2 No CRT SHA-256 3K Signature Fast High 447 590 024 6993 ms
v2.2 n/a SHA-256 3K Verification Small n/a 3 731 360 58 ms
v2.2 n/a SHA-256 3K Verification Fast n/a 3 727 240 58 ms


The table below shows RSA flash memory and RAM usage (in bytes).

PKCS#1 Priv. key mod. exp. method Hash method Modulus size Operation RSA mathematics configuration Priv. key mod. exp. implementation Code Constant data Global data Stack usage Working buffer
v2.2 CRT SHA-256 3K Signature Small Low 6850 bytes 372 bytes 0 bytes 668 bytes 3704 bytes
v2.2 CRT SHA-256 3K Signature Small Mid 7086 bytes 372 bytes 0 bytes 668 bytes 4308 bytes
v2.2 CRT SHA-256 3K Signature Small High 7086 bytes 372 bytes 0 bytes 668 bytes 6708 bytes
v2.2 CRT SHA-256 3K Signature Fast Low 7220 bytes 372 bytes 0 bytes 668 bytes 3704 bytes
v2.2 CRT SHA-256 3K Signature Fast Mid 7456 bytes 372 bytes 0 bytes 668 bytes 4308 bytes
v2.2 CRT SHA-256 3K Signature Fast High 7456 bytes 372 bytes 0 bytes 668 bytes 6708 bytes
v2.2 No CRT SHA-256 3K Signature Small Low 5918 bytes 364 bytes 0 bytes 668 bytes 3484 bytes
v2.2 No CRT SHA-256 3K Signature Small Mid 6154 bytes 364 bytes 0 bytes 668 bytes 4664 bytes
v2.2 No CRT SHA-256 3K Signature Small High 6154 bytes 364 bytes 0 bytes 668 bytes 9368 bytes
v2.2 No CRT SHA-256 3K Signature Fast Low 6288 bytes 364 bytes 0 bytes 668 bytes 3484 bytes
v2.2 No CRT SHA-256 3K Signature Fast Mid 6524 bytes 364 bytes 0 bytes 668 bytes 4664 bytes
v2.2 No CRT SHA-256 3K Signature Fast High 6524 bytes 364 bytes 0 bytes 668 bytes 9368 bytes
v2.2 n/a SHA-256 3K Verification Small n/a 6102 bytes 368 bytes 0 bytes 684 bytes 3108 bytes
v2.2 n/a SHA-256 3K Verification Fast n/a 6472 bytes 368 bytes 0 bytes 684 bytes 3108 bytes