Cryptographic Performances on STM32L5 Series

Revision as of 13:38, 30 April 2021 by Registered User (Created page with "{{DISPLAYTITLE:Cryptographic Performances on STM32L5 Series}} == Measurement configuration == === Hardware configuration === {| class="st-table" | '''''STM32 MCU''''' || ST...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


1. Measurement configuration

1.1. Hardware configuration

STM32 MCU STM32L552ZET6Q
Die @cfg1;0030.00xx@
Revision @cfg1;0030.00xx@
Board NUCLEO-L552ZE-Q

1.2. Firmware Configuration

Cryptographic Library version 040000B1

1.3. System Configuration

System Core Clock Frequency 110 MHz
Flash latency 5 wait states
Voltage scaling Range 0
Dual bank 0 (0: Single / 1: Dual)
ICACHE peripheral 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 us.
  • Data flow: a big message is encrypted or decrypted by chunk. Bit rate is given in bytes 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 (in us)
AES CBC 128Bits 16 bytes Encryption Small 4524 41
AES CBC 128Bits 16 bytes Encryption Fast 4723 42
AES CBC 128Bits 32 bytes Encryption Small 5443 49
AES CBC 128Bits 32 bytes Encryption Fast 5166 46
AES CBC 128Bits 64 bytes Encryption Small 8842 80
AES CBC 128Bits 64 bytes Encryption Fast 7831 71
AES CBC 128Bits 128 bytes Encryption Small 15639 142
AES CBC 128Bits 128 bytes Encryption Fast 13151 119
AES CBC 192Bits 16 bytes Encryption Small 4795 43
AES CBC 192Bits 16 bytes Encryption Fast 4986 45
AES CBC 192Bits 32 bytes Encryption Small 6067 55
AES CBC 192Bits 32 bytes Encryption Fast 5640 51
AES CBC 192Bits 64 bytes Encryption Small 10054 91
AES CBC 192Bits 64 bytes Encryption Fast 8675 78
AES CBC 192Bits 128 bytes Encryption Small 18029 163
AES CBC 192Bits 128 bytes Encryption Fast 14736 133
AES CBC 256Bits 16 bytes Encryption Small 5419 49
AES CBC 256Bits 16 bytes Encryption Fast 5484 49
AES CBC 256Bits 32 bytes Encryption Small 7026 63
AES CBC 256Bits 32 bytes Encryption Fast 6230 56
AES CBC 256Bits 64 bytes Encryption Small 11586 105
AES CBC 256Bits 64 bytes Encryption Fast 9723 88
AES CBC 256Bits 128 bytes Encryption Small 20720 188
AES CBC 256Bits 128 bytes Encryption Fast 16681 151
AES CBC 128Bits 16 bytes Decryption Small 6359 57
AES CBC 128Bits 16 bytes Decryption Fast 5912 53
AES CBC 128Bits 32 bytes Decryption Small 9089 82
AES CBC 128Bits 32 bytes Decryption Fast 6219 56
AES CBC 128Bits 64 bytes Decryption Small 16051 145
AES CBC 128Bits 64 bytes Decryption Fast 8929 81
AES CBC 128Bits 128 bytes Decryption Small 29964 272
AES CBC 128Bits 128 bytes Decryption Fast 14325 130
AES CBC 192Bits 16 bytes Decryption Small 7059 64
AES CBC 192Bits 16 bytes Decryption Fast 6459 58
AES CBC 192Bits 32 bytes Decryption Small 10459 95
AES CBC 192Bits 32 bytes Decryption Fast 7012 63
AES CBC 192Bits 64 bytes Decryption Small 18776 170
AES CBC 192Bits 64 bytes Decryption Fast 10130 92
AES CBC 192Bits 128 bytes Decryption Small 35395 321
AES CBC 192Bits 128 bytes Decryption Fast 16352 148
AES CBC 256Bits 16 bytes Decryption Small 8095 73
AES CBC 256Bits 16 bytes Decryption Fast 7232 65
AES CBC 256Bits 32 bytes Decryption Small 12201 110
AES CBC 256Bits 32 bytes Decryption Fast 7895 71
AES CBC 256Bits 64 bytes Decryption Small 21889 198
AES CBC 256Bits 64 bytes Decryption Fast 11392 103
AES CBC 256Bits 128 bytes Decryption Small 41223 374
AES CBC 256Bits 128 bytes Decryption Fast 18357 166
Cryptolib STM32L552 AES CBC SB Enc.svg
Cryptolib STM32L552 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 2960 380 1 524
Encryption Fast 3292 1404 1 548
Decryption Small 3056 636 1 552
Decryption Fast 3716 1660 1 556
Cryptolib STM32L552 AES CBC SB Enc FP.svg
Cryptolib STM32L552 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 (in KBytes per s)
AES CBC 128Bits 8000 128 bytes Encryption Small 879648 1000
AES CBC 128Bits 8000 128 bytes Encryption Fast 706960 1244
AES CBC 128Bits 8000 512 bytes Encryption Small 871624 1009
AES CBC 128Bits 8000 512 bytes Encryption Fast 692672 1270
AES CBC 128Bits 8000 1024 bytes Encryption Small 869136 1012
AES CBC 128Bits 8000 1024 bytes Encryption Fast 689168 1276
AES CBC 128Bits 8000 2048 bytes Encryption Small 865984 1016
AES CBC 128Bits 8000 2048 bytes Encryption Fast 685584 1283
AES CBC 192Bits 8000 128 bytes Encryption Small 1024376 859
AES CBC 192Bits 8000 128 bytes Encryption Fast 807640 1089
AES CBC 192Bits 8000 512 bytes Encryption Small 1016432 865
AES CBC 192Bits 8000 512 bytes Encryption Fast 793184 1109
AES CBC 192Bits 8000 1024 bytes Encryption Small 1013992 867
AES CBC 192Bits 8000 1024 bytes Encryption Fast 789688 1114
AES CBC 192Bits 8000 2048 bytes Encryption Small 1010864 870
AES CBC 192Bits 8000 2048 bytes Encryption Fast 785952 1119
AES CBC 256Bits 8000 128 bytes Encryption Small 1169392 752
AES CBC 256Bits 8000 128 bytes Encryption Fast 908624 968
AES CBC 256Bits 8000 512 bytes Encryption Small 1161464 757
AES CBC 256Bits 8000 512 bytes Encryption Fast 894288 984
AES CBC 256Bits 8000 1024 bytes Encryption Small 1158968 759
AES CBC 256Bits 8000 1024 bytes Encryption Fast 890688 988
AES CBC 256Bits 8000 2048 bytes Encryption Small 1155856 761
AES CBC 256Bits 8000 2048 bytes Encryption Fast 886936 992
AES CBC 128Bits 8000 128 bytes Decryption Small 1766576 498
AES CBC 128Bits 8000 128 bytes Decryption Fast 705608 1247
AES CBC 128Bits 8000 512 bytes Decryption Small 1758656 500
AES CBC 128Bits 8000 512 bytes Decryption Fast 697672 1261
AES CBC 128Bits 8000 1024 bytes Decryption Small 1756128 501
AES CBC 128Bits 8000 1024 bytes Decryption Fast 695176 1265
AES CBC 128Bits 8000 2048 bytes Decryption Small 1753096 501
AES CBC 128Bits 8000 2048 bytes Decryption Fast 691664 1272
AES CBC 192Bits 8000 128 bytes Decryption Small 2107760 417
AES CBC 192Bits 8000 128 bytes Decryption Fast 812632 1082
AES CBC 192Bits 8000 512 bytes Decryption Small 2099840 419
AES CBC 192Bits 8000 512 bytes Decryption Fast 800648 1099
AES CBC 192Bits 8000 1024 bytes Decryption Small 2097272 419
AES CBC 192Bits 8000 1024 bytes Decryption Fast 797544 1103
AES CBC 192Bits 8000 2048 bytes Decryption Small 2094272 420
AES CBC 192Bits 8000 2048 bytes Decryption Fast 793672 1108
AES CBC 256Bits 8000 128 bytes Decryption Small 2448496 359
AES CBC 256Bits 8000 128 bytes Decryption Fast 909240 967
AES CBC 256Bits 8000 512 bytes Decryption Small 2440712 360
AES CBC 256Bits 8000 512 bytes Decryption Fast 901496 976
AES CBC 256Bits 8000 1024 bytes Decryption Small 2438312 360
AES CBC 256Bits 8000 1024 bytes Decryption Fast 898744 979
AES CBC 256Bits 8000 2048 bytes Decryption Small 2435104 361
AES CBC 256Bits 8000 2048 bytes Decryption Fast 895408 982
Cryptolib STM32L552 AES CBC DF Enc.svg
Cryptolib STM32L552 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 2852 372 1 140
Encryption Fast 3184 1396 1 172
Decryption Small 2948 628 1 176
Decryption Fast 3608 1652 1 180
Cryptolib STM32L552 AES CBC DF Enc FP.svg
Cryptolib STM32L552 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 us) needed to perform described operation.

HASH Mode Buffer Size Cycles Time (in us)
SHA256 16 bytes 5781 52
SHA256 32 bytes 5257 47
SHA256 64 bytes 8447 76
SHA256 128 bytes 11380 103
SHA384 16 bytes 17455 158
SHA384 32 bytes 17000 154
SHA384 64 bytes 17220 156
SHA384 128 bytes 30928 281
Cryptolib STM32L552 HASH SB Dig.svg


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

HASH Mode Code Constant data Global Data Stack usage
SHA256 1780 296 1 564
SHA384 3012 744 1 1124
Cryptolib STM32L552 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 (in KBytes per s)
SHA256 8000 128 bytes 400113 2199
SHA256 8000 512 bytes 377334 2332
SHA256 8000 1024 bytes 373587 2355
SHA256 8000 2048 bytes 371724 2367
SHA384 8000 128 bytes 879743 1000
SHA384 8000 512 bytes 839728 1047
SHA384 8000 1024 bytes 832927 1056
SHA384 8000 2048 bytes 829466 1060
Cryptolib STM32L552 HASH DF Dig.svg


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

HASH Mode Cycles Time (in us)
SHA256 4349 39
SHA384 15645 142

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

HASH Mode Code Constant data Global Data Stack usage
SHA256 1788 288 1 372
SHA384 3020 736 1 828
Cryptolib STM32L552 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 Hash method Operation ECC Mathematics configuration Curve definition Cycles Time (in ms)
SECP256R1 SHA-256 Signature Small Low 2921944 26
SECP256R1 SHA-256 Signature Small High 2834760 25
SECP256R1 SHA-256 Signature SuperFast Low 1927128 17
SECP256R1 SHA-256 Signature SuperFast High 1856584 16
SECP256R1 SHA-256 Verification Small Low 7008160 63
SECP256R1 SHA-256 Verification Small High 6234688 56
SECP256R1 SHA-256 Verification SuperFast Low 4708920 42
SECP256R1 SHA-256 Verification SuperFast High 4113320 37
SECP384R1 SHA-384 Signature Small Low 8257704 75
SECP384R1 SHA-384 Signature Small High 7893824 71
SECP384R1 SHA-384 Signature Fast Low 7042160 64
SECP384R1 SHA-384 Signature Fast High 6713392 61
SECP384R1 SHA-384 Verification Small Low 19751304 179
SECP384R1 SHA-384 Verification Small High 17163528 156
SECP384R1 SHA-384 Verification Fast Low 17050312 155
SECP384R1 SHA-384 Verification Fast High 14639032 133
Cryptolib STM32L552 ECDSA Sig.svg
Cryptolib STM32L552 ECDSA Ver.svg


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

Curve Hash method Operation ECC Mathematics configuration Curve definition Code Constant data Global Data Stack usage Working buffer
SECP256R1 SHA-256 Signature Small Low 11636 1184 1 328 628
SECP256R1 SHA-256 Signature Small High 11636 1568 1 328 696
SECP256R1 SHA-256 Signature SuperFast Low 12946 1184 1 332 628
SECP256R1 SHA-256 Signature SuperFast High 12946 1568 1 332 696
SECP256R1 SHA-256 Verification Small Low 12158 1200 1 424 856
SECP256R1 SHA-256 Verification Small High 12158 1584 1 424 1648
SECP256R1 SHA-256 Verification SuperFast Low 13468 1200 1 428 856
SECP256R1 SHA-256 Verification SuperFast High 13468 1584 1 428 1648
SECP384R1 SHA-384 Signature Small Low 11636 1664 1 328 884
SECP384R1 SHA-384 Signature Small High 11636 2240 1 328 984
SECP384R1 SHA-384 Signature Fast Low 12006 1664 1 344 884
SECP384R1 SHA-384 Signature Fast High 12006 2240 1 344 984
SECP384R1 SHA-384 Verification Small Low 12158 1680 1 424 1192
SECP384R1 SHA-384 Verification Small High 12158 2256 1 424 2272
SECP384R1 SHA-384 Verification Fast Low 12528 1680 1 440 1192
SECP384R1 SHA-384 Verification Fast High 12528 2256 1 440 2272
Cryptolib STM32L552 ECDSA SECP256R1 Sig FP.svg
Cryptolib STM32L552 ECDSA SECP256R1 Ver FP.svg
Cryptolib STM32L552 ECDSA SECP384R1 Sig FP.svg
Cryptolib STM32L552 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 (in ms)
Ed25519 1023 Signature Small OptLow 4515768 41
Ed25519 1023 Signature Small OptHigh 2635208 23
Ed25519 1023 Signature SuperFast OptLow 3226880 29
Ed25519 1023 Signature SuperFast OptHigh 1919424 17
Ed25519 1023 Verification Small OptLow 6795016 61
Ed25519 1023 Verification Small OptHigh 5960056 54
Ed25519 1023 Verification SuperFast OptLow 4637648 42
Ed25519 1023 Verification SuperFast OptHigh 4074152 37
Cryptolib STM32L552 EdDSA Sig.svg
Cryptolib STM32L552 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 Signature Small OptLow 14100 1744 1 1236 1388
Ed25519 1023 Signature Small OptHigh 14506 2896 1 1236 1388
Ed25519 1023 Signature SuperFast OptLow 15410 1744 1 1236 1388
Ed25519 1023 Signature SuperFast OptHigh 15816 2896 1 1236 1388
Ed25519 1023 Verification Small OptLow 14186 1748 1 1244 1152
Ed25519 1023 Verification Small OptHigh 14592 2900 1 1244 1992
Ed25519 1023 Verification SuperFast OptLow 15496 1748 1 1244 1152
Ed25519 1023 Verification SuperFast OptHigh 15902 2900 1 1244 1992
Cryptolib STM32L552 EdDSA Sig FP.svg
Cryptolib STM32L552 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 (in ms)
v2.2 CRT SHA-256 3K Signature Small Low 198353488 1803
v2.2 CRT SHA-256 3K Signature Small Mid 149293128 1357
v2.2 CRT SHA-256 3K Signature Small High 125370280 1139
v2.2 CRT SHA-256 3K Signature Fast Low 158894256 1444
v2.2 CRT SHA-256 3K Signature Fast Mid 119728856 1088
v2.2 CRT SHA-256 3K Signature Fast High 100074160 909
v2.2 No CRT SHA-256 3K Signature Small Low 763443440 6940
v2.2 No CRT SHA-256 3K Signature Small Mid 573386720 5212
v2.2 No CRT SHA-256 3K Signature Small High 479617728 4360
v2.2 No CRT SHA-256 3K Signature Fast Low 606866632 5516
v2.2 No CRT SHA-256 3K Signature Fast Mid 455949368 4144
v2.2 No CRT SHA-256 3K Signature Fast High 380471192 3458
v2.2 n/a SHA-256 3K Verification Small n/a 3813856 34
v2.2 n/a SHA-256 3K Verification Fast n/a 3286840 29
Cryptolib STM32L552 RSA Sig.svg
Cryptolib STM32L552 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 6986 371 5 700 3704
v2.2 CRT SHA-256 3K Signature Small Mid 7234 371 5 700 4308
v2.2 CRT SHA-256 3K Signature Small High 7234 371 5 700 6708
v2.2 CRT SHA-256 3K Signature Fast Low 7356 371 5 700 3704
v2.2 CRT SHA-256 3K Signature Fast Mid 7604 371 5 700 4308
v2.2 CRT SHA-256 3K Signature Fast High 7604 371 5 700 6708
v2.2 No CRT SHA-256 3K Signature Small Low 6016 363 5 700 3484
v2.2 No CRT SHA-256 3K Signature Small Mid 6264 363 5 700 4664
v2.2 No CRT SHA-256 3K Signature Small High 6264 363 5 700 9368
v2.2 No CRT SHA-256 3K Signature Fast Low 6386 363 5 700 3484
v2.2 No CRT SHA-256 3K Signature Fast Mid 6634 363 5 700 4664
v2.2 No CRT SHA-256 3K Signature Fast High 6634 363 5 700 9368
v2.2 n/a SHA-256 3K Verification Small n/a 6762 367 5 716 3108
v2.2 n/a SHA-256 3K Verification Fast n/a 7132 367 5 716 3108
Cryptolib STM32L552 RSA 3K CRT Sig FP.svg
Cryptolib STM32L552 RSA 3K NoCRT Sig FP.svg
Cryptolib STM32L552 RSA 3K Ver FP.svg


No categories assignedEdit