Cryptographic Performances on STM32L0 Series

Revision as of 15:16, 6 May 2021 by Registered User (Created page with "{{DISPLAYTITLE:Cryptographic Performances on STM32L0 Series}} == Measurement configuration == === Hardware configuration === {| class="st-table" | '''''STM32 MCU''''' ||...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


1. Measurement configuration

1.1. Hardware configuration

STM32 MCU STM32L073RZ
Device ID 0x447
Revision ID 0x2008
Board STM32L073RZ-Nucleo Rev C

1.2. Firmware Configuration

Cryptographic Library version 040000B1

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 build with High Speed optimization setting enabled.


2. Performances Values

2.1. AES Symmetric key encryption & decryption

In this section we provide 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 Kbytes per s.

2.1.1. Sole buffer mode

In this mode, operation is performed in one single call to one of the CMOX library APIs to encrypt or decrypt the whole message size.

Tables below shows the clock cycles and time (in us) needed to perform described operation in small and in fast configuration.

AES Mode Key size Buffer Size Cipher Operation Configuration Cycles Time
AES CBC 128Bits 32 bytes Encryption Small 9193 287 µs
AES CBC 128Bits 32 bytes Encryption Fast 7795 243 µs
AES CBC 128Bits 64 bytes Encryption Small 15689 490 µs
AES CBC 128Bits 64 bytes Encryption Fast 12889 402 µs
AES CBC 128Bits 128 bytes Encryption Small 28673 896 µs
AES CBC 128Bits 128 bytes Encryption Fast 23074 721 µs
AES CBC 192Bits 32 bytes Encryption Small 10393 324 µs
AES CBC 192Bits 32 bytes Encryption Fast 8672 271 µs
AES CBC 192Bits 64 bytes Encryption Small 18053 564 µs
AES CBC 192Bits 64 bytes Encryption Fast 14612 456 µs
AES CBC 192Bits 128 bytes Encryption Small 33361 1042 µs
AES CBC 192Bits 128 bytes Encryption Fast 26486 827 µs
AES CBC 256Bits 32 bytes Encryption Small 11949 373 µs
AES CBC 256Bits 32 bytes Encryption Fast 9908 309 µs
AES CBC 256Bits 64 bytes Encryption Small 20771 649 µs
AES CBC 256Bits 64 bytes Encryption Fast 16690 521 µs
AES CBC 256Bits 128 bytes Encryption Small 38399 1199 µs
AES CBC 256Bits 128 bytes Encryption Fast 30254 945 µs
AES CBC 128Bits 32 bytes Decryption Small 13114 409 µs
AES CBC 128Bits 32 bytes Decryption Fast 9956 311 µs
AES CBC 128Bits 64 bytes Decryption Small 23528 735 µs
AES CBC 128Bits 64 bytes Decryption Fast 15260 476 µs
AES CBC 128Bits 128 bytes Decryption Small 44350 1385 µs
AES CBC 128Bits 128 bytes Decryption Fast 25866 808 µs
AES CBC 192Bits 32 bytes Decryption Small 15175 474 µs
AES CBC 192Bits 32 bytes Decryption Fast 11297 353 µs
AES CBC 192Bits 64 bytes Decryption Small 27614 862 µs
AES CBC 192Bits 64 bytes Decryption Fast 17481 546 µs
AES CBC 192Bits 128 bytes Decryption Small 52488 1640 µs
AES CBC 192Bits 128 bytes Decryption Fast 29849 932 µs
AES CBC 256Bits 32 bytes Decryption Small 17589 549 µs
AES CBC 256Bits 32 bytes Decryption Fast 12992 406 µs
AES CBC 256Bits 64 bytes Decryption Small 32048 1001 µs
AES CBC 256Bits 64 bytes Decryption Fast 20058 626 µs
AES CBC 256Bits 128 bytes Decryption Small 60972 1905 µs
AES CBC 256Bits 128 bytes Decryption Fast 34189 1068 µs
Cryptolib STM32L073 AES CBC SB Enc.svg
Cryptolib STM32L073 AES CBC SB Dec.svg


Table below shows flash and RAM usage (in bytes).

Cipher Operation Configuration Code Constant data Global Data Stack usage
Encryption Small 3028 bytes 380 bytes 1 bytes 536 bytes
Encryption Fast 3276 bytes 1404 bytes 1 bytes 540 bytes
Decryption Small 3104 bytes 636 bytes 1 bytes 584 bytes
Decryption Fast 3696 bytes 1660 bytes 1 bytes 560 bytes
Cryptolib STM32L073 AES CBC SB Enc FP.svg
Cryptolib STM32L073 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

Tables below shows the clock cycles and bit rate (in KBytes 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 128Bits 8000 bytes 128 bytes Encryption Small 1639800 156 kB/s
AES CBC 128Bits 8000 bytes 128 bytes Encryption Fast 1289976 198 kB/s
AES CBC 128Bits 8000 bytes 512 bytes Encryption Small 1631200 156 kB/s
AES CBC 128Bits 8000 bytes 512 bytes Encryption Fast 1281376 199 kB/s
AES CBC 128Bits 8000 bytes 1024 bytes Encryption Small 1629736 157 kB/s
AES CBC 128Bits 8000 bytes 1024 bytes Encryption Fast 1279912 200 kB/s
AES CBC 128Bits 8000 bytes 2048 bytes Encryption Small 1629008 157 kB/s
AES CBC 128Bits 8000 bytes 2048 bytes Encryption Fast 1279176 200 kB/s
AES CBC 192Bits 8000 bytes 128 bytes Encryption Small 1931320 132 kB/s
AES CBC 192Bits 8000 bytes 128 bytes Encryption Fast 1501376 170 kB/s
AES CBC 192Bits 8000 bytes 512 bytes Encryption Small 1922720 133 kB/s
AES CBC 192Bits 8000 bytes 512 bytes Encryption Fast 1492776 171 kB/s
AES CBC 192Bits 8000 bytes 1024 bytes Encryption Small 1921256 133 kB/s
AES CBC 192Bits 8000 bytes 1024 bytes Encryption Fast 1491320 171 kB/s
AES CBC 192Bits 8000 bytes 2048 bytes Encryption Small 1920528 133 kB/s
AES CBC 192Bits 8000 bytes 2048 bytes Encryption Fast 1490584 171 kB/s
AES CBC 256Bits 8000 bytes 128 bytes Encryption Small 2222936 115 kB/s
AES CBC 256Bits 8000 bytes 128 bytes Encryption Fast 1712792 149 kB/s
AES CBC 256Bits 8000 bytes 512 bytes Encryption Small 2214336 115 kB/s
AES CBC 256Bits 8000 bytes 512 bytes Encryption Fast 1704200 150 kB/s
AES CBC 256Bits 8000 bytes 1024 bytes Encryption Small 2212872 115 kB/s
AES CBC 256Bits 8000 bytes 1024 bytes Encryption Fast 1702736 150 kB/s
AES CBC 256Bits 8000 bytes 2048 bytes Encryption Small 2212144 115 kB/s
AES CBC 256Bits 8000 bytes 2048 bytes Encryption Fast 1702000 150 kB/s
AES CBC 128Bits 8000 bytes 128 bytes Decryption Small 2640856 96 kB/s
AES CBC 128Bits 8000 bytes 128 bytes Decryption Fast 1363456 187 kB/s
AES CBC 128Bits 8000 bytes 512 bytes Decryption Small 2629424 97 kB/s
AES CBC 128Bits 8000 bytes 512 bytes Decryption Fast 1352016 189 kB/s
AES CBC 128Bits 8000 bytes 1024 bytes Decryption Small 2626064 97 kB/s
AES CBC 128Bits 8000 bytes 1024 bytes Decryption Fast 1348656 189 kB/s
AES CBC 128Bits 8000 bytes 2048 bytes Decryption Small 2622088 97 kB/s
AES CBC 128Bits 8000 bytes 2048 bytes Decryption Fast 1344680 190 kB/s
AES CBC 192Bits 8000 bytes 128 bytes Decryption Small 3147336 81 kB/s
AES CBC 192Bits 8000 bytes 128 bytes Decryption Fast 1583856 161 kB/s
AES CBC 192Bits 8000 bytes 512 bytes Decryption Small 3135904 81 kB/s
AES CBC 192Bits 8000 bytes 512 bytes Decryption Fast 1572424 162 kB/s
AES CBC 192Bits 8000 bytes 1024 bytes Decryption Small 3132552 81 kB/s
AES CBC 192Bits 8000 bytes 1024 bytes Decryption Fast 1569072 163 kB/s
AES CBC 192Bits 8000 bytes 2048 bytes Decryption Small 3128568 81 kB/s
AES CBC 192Bits 8000 bytes 2048 bytes Decryption Fast 1565088 163 kB/s
AES CBC 256Bits 8000 bytes 128 bytes Decryption Small 3653992 70 kB/s
AES CBC 256Bits 8000 bytes 128 bytes Decryption Fast 1804320 141 kB/s
AES CBC 256Bits 8000 bytes 512 bytes Decryption Small 3642552 70 kB/s
AES CBC 256Bits 8000 bytes 512 bytes Decryption Fast 1792880 142 kB/s
AES CBC 256Bits 8000 bytes 1024 bytes Decryption Small 3639200 70 kB/s
AES CBC 256Bits 8000 bytes 1024 bytes Decryption Fast 1789528 143 kB/s
AES CBC 256Bits 8000 bytes 2048 bytes Decryption Small 3635224 70 kB/s
AES CBC 256Bits 8000 bytes 2048 bytes Decryption Fast 1785552 143 kB/s
Cryptolib STM32L073 AES CBC DF Enc.svg
Cryptolib STM32L073 AES CBC DF Dec.svg


Table below shows flash and RAM usage (in bytes).

Cipher Operation Configuration Code Constant data Global Data Stack usage
Encryption Small 2950 bytes 372 bytes 1 bytes 152 bytes
Encryption Fast 3198 bytes 1396 bytes 1 bytes 164 bytes
Decryption Small 3022 bytes 628 bytes 1 bytes 208 bytes
Decryption Fast 3614 bytes 1652 bytes 1 bytes 184 bytes
Cryptolib STM32L073 AES CBC DF Enc FP.svg
Cryptolib STM32L073 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, operation is performed in one single call to one of the CMOX library APIs to digest the whole message size.

Tables below shows the clock cycles and time (in µs) needed to perform described operation.

HASH Mode Buffer Size Cycles Time
SHA256 32 bytes 10575 330 µs
SHA256 64 bytes 18549 579 µs
SHA256 128 bytes 26428 825 µs
SHA384 32 bytes 38093 1190 µs
SHA384 64 bytes 38105 1190 µs
SHA384 128 bytes 72208 2256 µs
Cryptolib STM32L073 HASH SB Dig.svg


Table below shows flash and RAM usage (in bytes).

HASH Mode Code Constant data Global Data Stack usage
SHA256 1846 296 bytes 1 bytes 580 bytes
SHA384 3158 744 bytes 1 bytes 1132 bytes
Cryptolib STM32L073 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

Tables below shows the clock cycles and bit rate (in KBytes per second) needed to perform described operation.

HASH Mode Message size Chunk Size Cycles Bit Rate
SHA256 8000 bytes 128 bytes 1007541 254 kB/s
SHA256 8000 bytes 512 bytes 995039 257 kB/s
SHA256 8000 bytes 1024 bytes 992911 257 kB/s
SHA256 8000 bytes 2048 bytes 991847 258 kB/s
SHA384 8000 bytes 128 bytes 2129997 120 kB/s
SHA384 8000 bytes 512 bytes 2114254 121 kB/s
SHA384 8000 bytes 1024 bytes 2111550 121 kB/s
SHA384 8000 bytes 2048 bytes 2110198 121 kB/s
Cryptolib STM32L073 HASH DF Dig.svg


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

HASH Mode Cycles Time
SHA256 9878 308 µs
SHA384 37332 1166 µs

Table below shows flash and RAM usage (in bytes).

HASH Mode Code Constant data Global Data Stack usage
SHA256 1874 bytes 288 bytes 1 bytes 380 bytes
SHA384 3186 bytes 736 bytes 1 bytes 828 bytes
Cryptolib STM32L073 HASH DF Dig FP.svg


2.3. ECDSA Signature & Verification

In this section we provide the performance results for ECDSA Signature & Verification.

Tables below shows the 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 11431088 357 ms
SECP256R1 Signature Small High 11068032 345 ms
SECP256R1 Signature SuperFast Low 8729984 272 ms
SECP256R1 Signature SuperFast High 8463864 264 ms
SECP256R1 Verification Small Low 27062272 845 ms
SECP256R1 Verification Small High 23981072 749 ms
SECP256R1 Verification SuperFast Low 20897128 653 ms
SECP256R1 Verification SuperFast High 18521728 578 ms
SECP384R1 Signature Small Low 36070392 1127 ms
SECP384R1 Signature Small High 34441288 1076 ms
SECP384R1 Signature Fast Low 30905544 965 ms
SECP384R1 Signature Fast High 29457144 920 ms
SECP384R1 Verification Small Low 85178904 2661 ms
SECP384R1 Verification Small High 74033496 2313 ms
SECP384R1 Verification Fast Low 73474264 2296 ms
SECP384R1 Verification Fast High 63686760 1990 ms
Cryptolib STM32L073 ECDSA Sig.svg
Cryptolib STM32L073 ECDSA Ver.svg


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 11900 bytes 1184 bytes 1 bytes 320 bytes 628 bytes
SECP256R1 Signature Small High 11900 bytes 1568 bytes 1 bytes 320 bytes 696 bytes
SECP256R1 Signature SuperFast Low 15240 bytes 1184 bytes 1 bytes 368 bytes 628 bytes
SECP256R1 Signature SuperFast High 15240 bytes 1568 bytes 1 bytes 368 bytes 696 bytes
SECP256R1 Verification Small Low 12370 bytes 1200 bytes 1 bytes 408 bytes 856 bytes
SECP256R1 Verification Small High 12370 bytes 1584 bytes 1 bytes 408 bytes 1648 bytes
SECP256R1 Verification SuperFast Low 15710 bytes 1200 bytes 1 bytes 456 bytes 856 bytes
SECP256R1 Verification SuperFast High 15710 bytes 1584 bytes 1 bytes 456 bytes 1648 bytes
SECP384R1 Signature Small Low 11900 bytes 1664 bytes 1 bytes 320 bytes 884 bytes
SECP384R1 Signature Small High 11900 bytes 2240 bytes 1 bytes 320 bytes 984 bytes
SECP384R1 Signature Fast Low 12738 bytes 1664 bytes 1 bytes 312 bytes 884 bytes
SECP384R1 Signature Fast High 12738 bytes 2240 bytes 1 bytes 312 bytes 984 bytes
SECP384R1 Verification Small Low 12370 bytes 1680 bytes 1 bytes 408 bytes 1192 bytes
SECP384R1 Verification Small High 12370 bytes 2256 bytes 1 bytes 408 bytes 2272 bytes
SECP384R1 Verification Fast Low 13208 bytes 1680 bytes 1 bytes 400 bytes 1192 bytes
SECP384R1 Verification Fast High 13208 bytes 2256 bytes 1 bytes 400 bytes 2272 bytes
Cryptolib STM32L073 ECDSA SECP256R1 Sig FP.svg
Cryptolib STM32L073 ECDSA SECP256R1 Ver FP.svg
Cryptolib STM32L073 ECDSA SECP384R1 Sig FP.svg
Cryptolib STM32L073 ECDSA SECP384R1 Ver FP.svg


2.4. EdDSA Signature & Verification

In this section we provide the performance results for EdDSA Signature & Verification.

Tables below shows the 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 16244968 507 ms
Ed25519 1023 bytes Signature Small OptHigh 9340840 291 ms
Ed25519 1023 bytes Signature SuperFast OptLow 13025552 407 ms
Ed25519 1023 bytes Signature SuperFast OptHigh 7502368 234 ms
Ed25519 1023 bytes Verification Small OptLow 25536152 798 ms
Ed25519 1023 bytes Verification Small OptHigh 22325672 697 ms
Ed25519 1023 bytes Verification SuperFast OptLow 20046144 626 ms
Ed25519 1023 bytes Verification SuperFast OptHigh 17454368 545 ms
Cryptolib STM32L073 EdDSA Sig.svg
Cryptolib STM32L073 EdDSA Ver.svg


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 14550 bytes 1744 bytes 1 bytes 1236 bytes 1388 bytes
Ed25519 1023 bytes Signature Small OptHigh 14972 bytes 2896 bytes 1 bytes 1236 bytes 1388 bytes
Ed25519 1023 bytes Signature SuperFast OptLow 17890 bytes 1744 bytes 1 bytes 1236 bytes 1388 bytes
Ed25519 1023 bytes Signature SuperFast OptHigh 18312 bytes 2896 bytes 1 bytes 1236 bytes 1388 bytes
Ed25519 1023 bytes Verification Small OptLow 14608 bytes 1748 bytes 1 bytes 1236 bytes 1152 bytes
Ed25519 1023 bytes Verification Small OptHigh 15030 bytes 2900 bytes 1 bytes 1236 bytes 1992 bytes
Ed25519 1023 bytes Verification SuperFast OptLow 17948 bytes 1748 bytes 1 bytes 1236 bytes 1152 bytes
Ed25519 1023 bytes Verification SuperFast OptHigh 18370 bytes 2900 bytes 1 bytes 1236 bytes 1992 bytes
Cryptolib STM32L073 EdDSA Sig FP.svg
Cryptolib STM32L073 EdDSA Ver FP.svg


2.5. RSA Signature & Verification

In this section we provide the performance results for RSA Signature & Verification.

Tables below shows the 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 1023684504 31990 ms
v2.2 CRT SHA-256 3K Signature Small Mid 769493768 24046 ms
v2.2 CRT SHA-256 3K Signature Small High 645909952 20184 ms
v2.2 CRT SHA-256 3K Signature Fast Low 862068960 26939 ms
v2.2 CRT SHA-256 3K Signature Fast Mid 627699328 19615 ms
v2.2 CRT SHA-256 3K Signature Fast High 513013184 16031 ms
v2.2 No CRT SHA-256 3K Signature Small Low 4026263864 125820 ms
v2.2 No CRT SHA-256 3K Signature Small Mid 3022536552 94454 ms
v2.2 No CRT SHA-256 3K Signature Small High 2527734112 78991 ms
v2.2 No CRT SHA-256 3K Signature Fast Low 3381230512 105663 ms
v2.2 No CRT SHA-256 3K Signature Fast Mid 2452500600 76640 ms
v2.2 No CRT SHA-256 3K Signature Fast High 1993174792 62286 ms
v2.2 n/a SHA-256 3K Verification Small n/a 15942952 498 ms
v2.2 n/a SHA-256 3K Verification Fast n/a 13200872 412 ms
Cryptolib STM32L073 RSA Sig.svg
Cryptolib STM32L073 RSA Ver.svg


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 7260 bytes 369 bytes 5 bytes 708 bytes 3704 bytes
v2.2 CRT SHA-256 3K Signature Small Mid 7538 bytes 370 bytes 5 bytes 708 bytes 4308 bytes
v2.2 CRT SHA-256 3K Signature Small High 7538 bytes 370 bytes 5 bytes 708 bytes 6708 bytes
v2.2 CRT SHA-256 3K Signature Fast Low 8098 bytes 370 bytes 5 bytes 708 bytes 3704 bytes
v2.2 CRT SHA-256 3K Signature Fast Mid 8376 bytes 370 bytes 5 bytes 708 bytes 4308 bytes
v2.2 CRT SHA-256 3K Signature Fast High 8376 bytes 370 bytes 5 bytes 708 bytes 6708 bytes
v2.2 No CRT SHA-256 3K Signature Small Low 6274 bytes 362 bytes 5 bytes 708 bytes 3484 bytes
v2.2 No CRT SHA-256 3K Signature Small Mid 6552 bytes 362 bytes 5 bytes 708 bytes 4664 bytes
v2.2 No CRT SHA-256 3K Signature Small High 6552 bytes 362 bytes 5 bytes 708 bytes 9368 bytes
v2.2 No CRT SHA-256 3K Signature Fast Low 7112 bytes 361 bytes 5 bytes 708 bytes 3484 bytes
v2.2 No CRT SHA-256 3K Signature Fast Mid 7390 bytes 361 bytes 5 bytes 708 bytes 4664 bytes
v2.2 No CRT SHA-256 3K Signature Fast High 7390 bytes 361 bytes 5 bytes 708 bytes 9368 bytes
v2.2 n/a SHA-256 3K Verification Small n/a 7054 bytes 366 bytes 5 bytes 724 bytes 3108 bytes
v2.2 n/a SHA-256 3K Verification Fast n/a 7892 bytes 365 bytes 5 bytes 724 bytes 3108 bytes
Cryptolib STM32L073 RSA 3K CRT Sig FP.svg
Cryptolib STM32L073 RSA 3K NoCRT Sig FP.svg
Cryptolib STM32L073 RSA 3K Ver FP.svg


No categories assignedEdit