Cryptographic performance on STM32L1 Series

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


1. Measurement configuration

1.1. Hardware configuration

STM32 MCU STM32L152RET6
Device ID 0x437
Revision ID 0x1008
Board STM32L152RE-Nucleo Rev C

1.2. Firmware configuration

Cryptographic Library version 040000B1[ver. 1]
  1. This value corresponds to the information returned by a call to cmox_getInfos

1.3. System configuration

System Core Clock Frequency 32 MHz
Flash latency 1 wait states
Voltage scaling Range 1
Prefetch Cache (ART) 1 (0: disabled / 1: enabled)

1.4. Development toolchains and compilers

IAR Embedded Workbench IAR ANSI C/C++ Compiler V8.50.4.261/W32 for ARM
Info white.png Information
NOTE: The measurements are done using a project built with High Speed optimization setting enabled.


2. Performance values

2.1. AES symmetric key encryption & decryption

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

  • Sole buffer: one sole buffer is encrypted or decrypted. Time to perform is given in µs.
  • Data flow: a big message is encrypted or decrypted by chunk. 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 whole 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 6032 188 µs
AES CBC 128 bits 32 bytes Encryption Fast 5558 173 µs
AES CBC 128 bits 64 bytes Encryption Small 9873 308 µs
AES CBC 128 bits 64 bytes Encryption Fast 8938 279 µs
AES CBC 128 bits 128 bytes Encryption Small 17 550 548 µs
AES CBC 128 bits 128 bytes Encryption Fast 15 693 490 µs
AES CBC 192 bits 32 bytes Encryption Small 6686 208 µs
AES CBC 192 bits 32 bytes Encryption Fast 6103 190 µs
AES CBC 192 bits 64 bytes Encryption Small 11 151 348 µs
AES CBC 192 bits 64 bytes Encryption Fast 9990 312 µs
AES CBC 192 bits 128 bytes Encryption Small 20 070 627 µs
AES CBC 192 bits 128 bytes Encryption Fast 17 759 554 µs
AES CBC 256 bits 32 bytes Encryption Small 7683 240 µs
AES CBC 256 bits 32 bytes Encryption Fast 6986 218 µs
AES CBC 256 bits 64 bytes Encryption Small 12 765 398 µs
AES CBC 256 bits 64 bytes Encryption Fast 11 378 355 µs
AES CBC 256 bits 128 bytes Encryption Small 22 908 715 µs
AES CBC 256 bits 128 bytes Encryption Fast 20 159 629 µs
AES CBC 128 bits 32 bytes Decryption Small 10 332 322 µs
AES CBC 128 bits 32 bytes Decryption Fast 7195 224 µs
AES CBC 128 bits 64 bytes Decryption Small 18 478 577 µs
AES CBC 128 bits 64 bytes Decryption Fast 10 680 333 µs
AES CBC 128 bits 128 bytes Decryption Small 34 759 1086 µs
AES CBC 128 bits 128 bytes Decryption Fast 17 651 551 µs
AES CBC 192 bits 32 bytes Decryption Small 11 944 373 µs
AES CBC 192 bits 32 bytes Decryption Fast 8088 252 µs
AES CBC 192 bits 64 bytes Decryption Small 21 655 676 µs
AES CBC 192 bits 64 bytes Decryption Fast 12 103 378 µs
AES CBC 192 bits 128 bytes Decryption Small 41 082 1283 µs
AES CBC 192 bits 128 bytes Decryption Fast 20 128 629 µs
AES CBC 256 bits 32 bytes Decryption Small 13 888 434 µs
AES CBC 256 bits 32 bytes Decryption Fast 9324 291 µs
AES CBC 256 bits 64 bytes Decryption Small 25 171 786 µs
AES CBC 256 bits 64 bytes Decryption Fast 13 868 433 µs
AES CBC 256 bits 128 bytes Decryption Small 47 745 1492 µs
AES CBC 256 bits 128 bytes Decryption Fast 22 958 717 µs
Cryptolib STM32L152 AES CBC SB Enc.svg
Cryptolib STM32L152 AES CBC SB Dec.svg


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

Cipher operation Configuration Code Constant data Global data Stack usage
Encryption Small 2840 bytes 380 bytes 1 bytes 524 bytes
Encryption Fast 3092 bytes 1404 bytes 1 bytes 548 bytes
Decryption Small 2972 bytes 636 bytes 1 bytes 552 bytes
Decryption Fast 3548 bytes 1660 bytes 1 bytes 556 bytes
Cryptolib STM32L152 AES CBC SB Enc FP.svg
Cryptolib STM32L152 AES CBC SB Dec FP.svg


2.1.2. Data flow mode

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

  • cmox_cipher_init
  • cmox_cipher_setKey
  • cmox_cipher_setIV
  • cmox_cipher_append: called several times to encrypt or decrypt the whole message by chunk of fixed size

The table below shows the number of clock cycles and bit rate (in kilobytes per second) needed to perform described operation in small and in 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 971 480 263 kbyte/s
AES CBC 128 bits 8000 bytes 128 bytes Encryption Fast 855 704 299 kbyte/s
AES CBC 128 bits 8000 bytes 512 bytes Encryption Small 964 048 265 kbyte/s
AES CBC 128 bits 8000 bytes 512 bytes Encryption Fast 848 288 301 kbyte/s
AES CBC 128 bits 8000 bytes 1024 bytes Encryption Small 962 792 265 kbyte/s
AES CBC 128 bits 8000 bytes 1024 bytes Encryption Fast 847 024 302 kbyte/s
AES CBC 128 bits 8000 bytes 2048 bytes Encryption Small 962 160 266 kbyte/s
AES CBC 128 bits 8000 bytes 2048 bytes Encryption Fast 846 384 302 kbyte/s
AES CBC 192 bits 8000 bytes 128 bytes Encryption Small 1 126 920 227 kbyte/s
AES CBC 192 bits 8000 bytes 128 bytes Encryption Fast 982 512 260 kbyte/s
AES CBC 192 bits 8000 bytes 512 bytes Encryption Small 1 119 496 228 kbyte/s
AES CBC 192 bits 8000 bytes 512 bytes Encryption Fast 975 096 262 kbyte/s
AES CBC 192 bits 8000 bytes 1024 bytes Encryption Small 1 118 224 228 kbyte/s
AES CBC 192 bits 8000 bytes 1024 bytes Encryption Fast 973 824 262 kbyte/s
AES CBC 192 bits 8000 bytes 2048 bytes Encryption Small 1 117 600 229 kbyte/s
AES CBC 192 bits 8000 bytes 2048 bytes Encryption Fast 973 192 263 kbyte/s
AES CBC 256 bits 8000 bytes 128 bytes Encryption Small 1 282 464 199 kbyte/s
AES CBC 256 bits 8000 bytes 128 bytes Encryption Fast 1 109 416 230 kbyte/s
AES CBC 256 bits 8000 bytes 512 bytes Encryption Small 1 275 024 200 kbyte/s
AES CBC 256 bits 8000 bytes 512 bytes Encryption Fast 1 101 984 232 kbyte/s
AES CBC 256 bits 8000 bytes 1024 bytes Encryption Small 1 273 776 200 kbyte/s
AES CBC 256 bits 8000 bytes 1024 bytes Encryption Fast 1 100 728 232 kbyte/s
AES CBC 256 bits 8000 bytes 2048 bytes Encryption Small 1 273 136 201 kbyte/s
AES CBC 256 bits 8000 bytes 2048 bytes Encryption Fast 1 100 088 232 kbyte/s
AES CBC 128 bits 8000 bytes 128 bytes Decryption Small 2 069 600 123 kbyte/s
AES CBC 128 bits 8000 bytes 128 bytes Decryption Fast 907 416 282 kbyte/s
AES CBC 128 bits 8000 bytes 512 bytes Decryption Small 2 059 424 124 kbyte/s
AES CBC 128 bits 8000 bytes 512 bytes Decryption Fast 897 032 285 kbyte/s
AES CBC 128 bits 8000 bytes 1024 bytes Decryption Small 2 056 472 124 kbyte/s
AES CBC 128 bits 8000 bytes 1024 bytes Decryption Fast 893 928 286 kbyte/s
AES CBC 128 bits 8000 bytes 2048 bytes Decryption Small 2 052 976 124 kbyte/s
AES CBC 128 bits 8000 bytes 2048 bytes Decryption Fast 890 168 287 kbyte/s
AES CBC 192 bits 8000 bytes 128 bytes Decryption Small 2 461 952 103 kbyte/s
AES CBC 192 bits 8000 bytes 128 bytes Decryption Fast 1 039 696 246 kbyte/s
AES CBC 192 bits 8000 bytes 512 bytes Decryption Small 2 451 800 104 kbyte/s
AES CBC 192 bits 8000 bytes 512 bytes Decryption Fast 1 029 312 248 kbyte/s
AES CBC 192 bits 8000 bytes 1024 bytes Decryption Small 2 448 832 104 kbyte/s
AES CBC 192 bits 8000 bytes 1024 bytes Decryption Fast 1 026 208 249 kbyte/s
AES CBC 192 bits 8000 bytes 2048 bytes Decryption Small 2 445 328 104 kbyte/s
AES CBC 192 bits 8000 bytes 2048 bytes Decryption Fast 1 022 448 250 kbyte/s
AES CBC 256 bits 8000 bytes 128 bytes Decryption Small 2 854 560 89 kbyte/s
AES CBC 256 bits 8000 bytes 128 bytes Decryption Fast 1 172 144 218 kbyte/s
AES CBC 256 bits 8000 bytes 512 bytes Decryption Small 2 844 400 90 kbyte/s
AES CBC 256 bits 8000 bytes 512 bytes Decryption Fast 1 161 784 220 kbyte/s
AES CBC 256 bits 8000 bytes 1024 bytes Decryption Small 2 841 440 90 kbyte/s
AES CBC 256 bits 8000 bytes 1024 bytes Decryption Fast 1 158 672 220 kbyte/s
AES CBC 256 bits 8000 bytes 2048 bytes Decryption Small 2 837 936 90 kbyte/s
AES CBC 256 bits 8000 bytes 2048 bytes Decryption Fast 1 154 904 221 kbyte/s
Cryptolib STM32L152 AES CBC DF Enc.svg
Cryptolib STM32L152 AES CBC DF Dec.svg


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

Cipher operation Configuration Code Constant data Global data Stack usage
Encryption Small 2732 bytes 372 bytes 1 bytes 140 bytes
Encryption Fast 2984 bytes 1396 bytes 1 bytes 172 bytes
Decryption Small 2864 bytes 628 bytes 1 bytes 176 bytes
Decryption Fast 3440 bytes 1652 bytes 1 bytes 180 bytes
Cryptolib STM32L152 AES CBC DF Enc FP.svg
Cryptolib STM32L152 AES CBC DF Dec FP.svg


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. Time to perform is given in us.
  • Data flow: a big message is hashed by chunk. Bit rate is given in bytes per s.

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 described operation.

HASH mode Buffer size Cycles Time
SHA256 32 bytes 5724 178 µs
SHA256 64 bytes 9159 286 µs
SHA256 128 bytes 12 307 384 µs
SHA384 32 bytes 19 388 605 µs
SHA384 64 bytes 19 626 613 µs
SHA384 128 bytes 36 343 1135 µs
Cryptolib STM32L152 HASH SB Dig.svg


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

HASH mode Code Constant data Global data Stack usage
SHA256 1752 296 bytes 1 bytes 564 bytes
SHA384 2904 744 bytes 1 bytes 1124 bytes
Cryptolib STM32L152 HASH SB Dig FP.svg


2.2.2. Data flow mode

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

  • cmox_hash_init
  • cmox_hash_append: called several times to hash the whole message by chunk of fixed size
  • cmox_hash_generateTag

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

HASH mode Message size Chunk size Cycles Bit rate
SHA256 8000 bytes 128 bytes 435 407 587 kbyte/s
SHA256 8000 bytes 512 bytes 404 998 632 kbyte/s
SHA256 8000 bytes 1024 bytes 399 822 640 kbyte/s
SHA256 8000 bytes 2048 bytes 397 234 644 kbyte/s
SHA384 8000 bytes 128 bytes 1 075 430 238 kbyte/s
SHA384 8000 bytes 512 bytes 1 021 851 250 kbyte/s
SHA384 8000 bytes 1024 bytes 1 012 555 252 kbyte/s
SHA384 8000 bytes 2048 bytes 1 007 907 253 kbyte/s
Cryptolib STM32L152 HASH DF Dig.svg


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

HASH mode Cycles Time
SHA256 4725 147 µs
SHA384 18 114 566 µs

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

HASH mode Code Constant data Global data Stack usage
SHA256 1760 bytes 288 bytes 1 bytes 372 bytes
SHA384 2912 bytes 736 bytes 1 bytes 828 bytes
Cryptolib STM32L152 HASH DF Dig FP.svg


2.3. ECDSA signature & verification

In this section we provide the performance results for ECDSA signature & verification.

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

Curve Operation ECC mathematics configuration Curve definition Cycles Time
SECP256R1 Signature Small Low 6 131 424 191 ms
SECP256R1 Signature Small High 5 927 864 185 ms
SECP256R1 Verification Small Low 14 497 416 453 ms
SECP256R1 Verification Small High 12 845 088 401 ms
SECP384R1 Signature Small Low 18 333 904 572 ms
SECP384R1 Signature Small High 17 477 232 546 ms
SECP384R1 Verification Small Low 43 241 256 1351 ms
SECP384R1 Verification Small High 37 579 704 1174 ms
Cryptolib STM32L152 ECDSA Sig.svg
Cryptolib STM32L152 ECDSA Ver.svg


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

Curve Operation ECC mathematics configuration Curve definition Code Constant data Global data Stack usage Working buffer
SECP256R1 Signature Small Low 12 954 bytes 1184 bytes 1 bytes 360 bytes 628 bytes
SECP256R1 Signature Small High 12 954 bytes 1568 bytes 1 bytes 360 bytes 696 bytes
SECP256R1 Verification Small Low 13 438 bytes 1200 bytes 1 bytes 456 bytes 856 bytes
SECP256R1 Verification Small High 13 438 bytes 1584 bytes 1 bytes 456 bytes 1648 bytes
SECP384R1 Signature Small Low 12 954 bytes 1664 bytes 1 bytes 360 bytes 884 bytes
SECP384R1 Signature Small High 12 954 bytes 2240 bytes 1 bytes 360 bytes 984 bytes
SECP384R1 Verification Small Low 13 438 bytes 1680 bytes 1 bytes 456 bytes 1192 bytes
SECP384R1 Verification Small High 13 438 bytes 2256 bytes 1 bytes 456 bytes 2272 bytes
Cryptolib STM32L152 ECDSA SECP256R1 Sig FP.svg
Cryptolib STM32L152 ECDSA SECP256R1 Ver FP.svg
Cryptolib STM32L152 ECDSA SECP384R1 Sig FP.svg
Cryptolib STM32L152 ECDSA SECP384R1 Ver FP.svg


2.4. EdDSA signature & verification

In this section we provide the performance results for EdDSA signature & verification.

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

Curve Message size Operation ECC mathematics configuration Curve definition Cycles Time
Ed25519 1023 bytes Signature Small OptLow 9 077 592 283 ms
Ed25519 1023 bytes Signature Small OptHigh 5 213 408 162 ms
Ed25519 1023 bytes Verification Small OptLow 14 192 240 443 ms
Ed25519 1023 bytes Verification Small OptHigh 12 439 136 388 ms
Cryptolib STM32L152 EdDSA Sig.svg
Cryptolib STM32L152 EdDSA Ver.svg


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

Curve Message size Operation ECC mathematics configuration Curve definition Code Constant data Global data Stack usage Working buffer
Ed25519 1023 bytes Signature Small OptLow 15 306 bytes 1744 bytes 1 bytes 1236 bytes 1388 bytes
Ed25519 1023 bytes Signature Small OptHigh 15 712 bytes 2896 bytes 1 bytes 1236 bytes 1388 bytes
Ed25519 1023 bytes Verification Small OptLow 15 396 bytes 1748 bytes 1 bytes 1244 bytes 1152 bytes
Ed25519 1023 bytes Verification Small OptHigh 15 802 bytes 2900 bytes 1 bytes 1244 bytes 1992 bytes
Cryptolib STM32L152 EdDSA Sig FP.svg
Cryptolib STM32L152 EdDSA Ver FP.svg


2.5. RSA signature & verification

In this section we provide the performance results for RSA signature & verification.

The table below shows the number of clock cycles and time (in ms) needed to perform 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 471 052 432 14 720 ms
v2.2 CRT SHA-256 3K Signature Small Mid 354 206 184 11 068 ms
v2.2 CRT SHA-256 3K Signature Small High 296 878 408 9277 ms
v2.2 No CRT SHA-256 3K Signature Small Low 1 817 407 016 56 793 ms
v2.2 No CRT SHA-256 3K Signature Small Mid 1 364 481 928 42 640 ms
v2.2 No CRT SHA-256 3K Signature Small High 1 140 186 872 35 630 ms
v2.2 n/a SHA-256 3K Verification Small n/a 7 621 096 238 ms
Cryptolib STM32L152 RSA Sig.svg
Cryptolib STM32L152 RSA Ver.svg


The table below shows RSA Flash 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 8256 bytes 370 bytes 5 bytes 700 bytes 3704 bytes
v2.2 CRT SHA-256 3K Signature Small Mid 8504 bytes 370 bytes 5 bytes 700 bytes 4308 bytes
v2.2 CRT SHA-256 3K Signature Small High 8504 bytes 370 bytes 5 bytes 700 bytes 6708 bytes
v2.2 No CRT SHA-256 3K Signature Small Low 7286 bytes 362 bytes 5 bytes 700 bytes 3484 bytes
v2.2 No CRT SHA-256 3K Signature Small Mid 7534 bytes 362 bytes 5 bytes 700 bytes 4664 bytes
v2.2 No CRT SHA-256 3K Signature Small High 7534 bytes 362 bytes 5 bytes 700 bytes 9368 bytes
v2.2 n/a SHA-256 3K Verification Small n/a 8032 bytes 366 bytes 5 bytes 716 bytes 3108 bytes
Cryptolib STM32L152 RSA 3K CRT Sig FP.svg
Cryptolib STM32L152 RSA 3K NoCRT Sig FP.svg
Cryptolib STM32L152 RSA 3K Ver FP.svg