Cryptographic Performances on STM32G0 Series

Revision as of 15:13, 6 May 2021 by Registered User (Created page with "{{DISPLAYTITLE:Cryptographic Performances on STM32G0 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 STM32G071RB
Device ID 0x460
Revision ID 0x2000
Board NUCLEO-G071RB

1.2. Firmware Configuration

Cryptographic Library version 040000B1

1.3. System Configuration

System Core Clock Frequency 64 MHz
Flash latency 2 wait states
Voltage scaling Range 1
Instruction Cache (ART/ICU) 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 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 10142 158 µs
AES CBC 128Bits 32 bytes Encryption Fast 8921 139 µs
AES CBC 128Bits 64 bytes Encryption Small 17428 272 µs
AES CBC 128Bits 64 bytes Encryption Fast 14897 232 µs
AES CBC 128Bits 128 bytes Encryption Small 32000 500 µs
AES CBC 128Bits 128 bytes Encryption Fast 26849 419 µs
AES CBC 192Bits 32 bytes Encryption Small 11497 179 µs
AES CBC 192Bits 32 bytes Encryption Fast 9936 155 µs
AES CBC 192Bits 64 bytes Encryption Small 20107 314 µs
AES CBC 192Bits 64 bytes Encryption Fast 16928 264 µs
AES CBC 192Bits 128 bytes Encryption Small 37327 583 µs
AES CBC 192Bits 128 bytes Encryption Fast 30912 483 µs
AES CBC 256Bits 32 bytes Encryption Small 13250 207 µs
AES CBC 256Bits 32 bytes Encryption Fast 11304 176 µs
AES CBC 256Bits 64 bytes Encryption Small 23184 362 µs
AES CBC 256Bits 64 bytes Encryption Fast 19312 301 µs
AES CBC 256Bits 128 bytes Encryption Small 43052 672 µs
AES CBC 256Bits 128 bytes Encryption Fast 35328 552 µs
AES CBC 128Bits 32 bytes Decryption Small 14418 225 µs
AES CBC 128Bits 32 bytes Decryption Fast 11538 180 µs
AES CBC 128Bits 64 bytes Decryption Small 25974 405 µs
AES CBC 128Bits 64 bytes Decryption Fast 17798 278 µs
AES CBC 128Bits 128 bytes Decryption Small 49086 766 µs
AES CBC 128Bits 128 bytes Decryption Fast 30318 473 µs
AES CBC 192Bits 32 bytes Decryption Small 16686 260 µs
AES CBC 192Bits 32 bytes Decryption Fast 13100 204 µs
AES CBC 192Bits 64 bytes Decryption Small 30486 476 µs
AES CBC 192Bits 64 bytes Decryption Fast 20408 318 µs
AES CBC 192Bits 128 bytes Decryption Small 58086 907 µs
AES CBC 192Bits 128 bytes Decryption Fast 35024 547 µs
AES CBC 256Bits 32 bytes Decryption Small 19366 302 µs
AES CBC 256Bits 32 bytes Decryption Fast 15013 234 µs
AES CBC 256Bits 64 bytes Decryption Small 35410 553 µs
AES CBC 256Bits 64 bytes Decryption Fast 23381 365 µs
AES CBC 256Bits 128 bytes Decryption Small 67498 1054 µs
AES CBC 256Bits 128 bytes Decryption Fast 40117 626 µs
Cryptolib STM32G071 AES CBC SB Enc.svg
Cryptolib STM32G071 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 STM32G071 AES CBC SB Enc FP.svg
Cryptolib STM32G071 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 1856448 275 kB/s
AES CBC 128Bits 8000 bytes 128 bytes Encryption Fast 1530384 334 kB/s
AES CBC 128Bits 8000 bytes 512 bytes Encryption Small 1847568 277 kB/s
AES CBC 128Bits 8000 bytes 512 bytes Encryption Fast 1521552 336 kB/s
AES CBC 128Bits 8000 bytes 1024 bytes Encryption Small 1846056 277 kB/s
AES CBC 128Bits 8000 bytes 1024 bytes Encryption Fast 1520040 336 kB/s
AES CBC 128Bits 8000 bytes 2048 bytes Encryption Small 1845304 277 kB/s
AES CBC 128Bits 8000 bytes 2048 bytes Encryption Fast 1519296 336 kB/s
AES CBC 192Bits 8000 bytes 128 bytes Encryption Small 2187448 234 kB/s
AES CBC 192Bits 8000 bytes 128 bytes Encryption Fast 1784384 286 kB/s
AES CBC 192Bits 8000 bytes 512 bytes Encryption Small 2178568 235 kB/s
AES CBC 192Bits 8000 bytes 512 bytes Encryption Fast 1775552 288 kB/s
AES CBC 192Bits 8000 bytes 1024 bytes Encryption Small 2177056 235 kB/s
AES CBC 192Bits 8000 bytes 1024 bytes Encryption Fast 1774048 288 kB/s
AES CBC 192Bits 8000 bytes 2048 bytes Encryption Small 2176296 235 kB/s
AES CBC 192Bits 8000 bytes 2048 bytes Encryption Fast 1773296 288 kB/s
AES CBC 256Bits 8000 bytes 128 bytes Encryption Small 2518448 203 kB/s
AES CBC 256Bits 8000 bytes 128 bytes Encryption Fast 2038392 251 kB/s
AES CBC 256Bits 8000 bytes 512 bytes Encryption Small 2509568 204 kB/s
AES CBC 256Bits 8000 bytes 512 bytes Encryption Fast 2029552 252 kB/s
AES CBC 256Bits 8000 bytes 1024 bytes Encryption Small 2508056 204 kB/s
AES CBC 256Bits 8000 bytes 1024 bytes Encryption Fast 2028048 252 kB/s
AES CBC 256Bits 8000 bytes 2048 bytes Encryption Small 2507296 204 kB/s
AES CBC 256Bits 8000 bytes 2048 bytes Encryption Fast 2027296 252 kB/s
AES CBC 128Bits 8000 bytes 128 bytes Decryption Small 2926544 174 kB/s
AES CBC 128Bits 8000 bytes 128 bytes Decryption Fast 1602360 319 kB/s
AES CBC 128Bits 8000 bytes 512 bytes Decryption Small 2914088 175 kB/s
AES CBC 128Bits 8000 bytes 512 bytes Decryption Fast 1590048 322 kB/s
AES CBC 128Bits 8000 bytes 1024 bytes Decryption Small 2910672 175 kB/s
AES CBC 128Bits 8000 bytes 1024 bytes Decryption Fast 1586672 322 kB/s
AES CBC 128Bits 8000 bytes 2048 bytes Decryption Small 2906856 176 kB/s
AES CBC 128Bits 8000 bytes 2048 bytes Decryption Fast 1582864 323 kB/s
AES CBC 192Bits 8000 bytes 128 bytes Decryption Small 3487296 146 kB/s
AES CBC 192Bits 8000 bytes 128 bytes Decryption Fast 1864608 274 kB/s
AES CBC 192Bits 8000 bytes 512 bytes Decryption Small 3475032 147 kB/s
AES CBC 192Bits 8000 bytes 512 bytes Decryption Fast 1852096 276 kB/s
AES CBC 192Bits 8000 bytes 1024 bytes Decryption Small 3471656 147 kB/s
AES CBC 192Bits 8000 bytes 1024 bytes Decryption Fast 1848680 276 kB/s
AES CBC 192Bits 8000 bytes 2048 bytes Decryption Small 3467856 147 kB/s
AES CBC 192Bits 8000 bytes 2048 bytes Decryption Fast 1844864 277 kB/s
AES CBC 256Bits 8000 bytes 128 bytes Decryption Small 4048536 126 kB/s
AES CBC 256Bits 8000 bytes 128 bytes Decryption Fast 2129360 240 kB/s
AES CBC 256Bits 8000 bytes 512 bytes Decryption Small 4036080 126 kB/s
AES CBC 256Bits 8000 bytes 512 bytes Decryption Fast 2117056 241 kB/s
AES CBC 256Bits 8000 bytes 1024 bytes Decryption Small 4032680 126 kB/s
AES CBC 256Bits 8000 bytes 1024 bytes Decryption Fast 2113672 242 kB/s
AES CBC 256Bits 8000 bytes 2048 bytes Decryption Small 4028856 127 kB/s
AES CBC 256Bits 8000 bytes 2048 bytes Decryption Fast 2109864 242 kB/s
Cryptolib STM32G071 AES CBC DF Enc.svg
Cryptolib STM32G071 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 STM32G071 AES CBC DF Enc FP.svg
Cryptolib STM32G071 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 11081 173 µs
SHA256 64 bytes 19241 300 µs
SHA256 128 bytes 27309 426 µs
SHA384 32 bytes 38735 605 µs
SHA384 64 bytes 38745 605 µs
SHA384 128 bytes 73045 1141 µs
Cryptolib STM32G071 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 STM32G071 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 1031181 496 kB/s
SHA256 8000 bytes 512 bytes 1017269 503 kB/s
SHA256 8000 bytes 1024 bytes 1014901 504 kB/s
SHA256 8000 bytes 2048 bytes 1013717 505 kB/s
SHA384 8000 bytes 128 bytes 2143651 238 kB/s
SHA384 8000 bytes 512 bytes 2127898 240 kB/s
SHA384 8000 bytes 1024 bytes 2125194 240 kB/s
SHA384 8000 bytes 2048 bytes 2123842 241 kB/s
Cryptolib STM32G071 HASH DF Dig.svg


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

HASH Mode Cycles Time
SHA256 10336 161 µs
SHA384 37935 592 µ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 STM32G071 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 12375208 193 ms
SECP256R1 Signature Small High 11920184 186 ms
SECP256R1 Signature SuperFast Low 9316976 145 ms
SECP256R1 Signature SuperFast High 9035616 141 ms
SECP256R1 Verification Small Low 29309224 457 ms
SECP256R1 Verification Small High 25839976 403 ms
SECP256R1 Verification SuperFast Low 22311256 348 ms
SECP256R1 Verification SuperFast High 19781112 309 ms
SECP384R1 Signature Small Low 39214864 612 ms
SECP384R1 Signature Small High 37467128 585 ms
SECP384R1 Signature Fast Low 33184800 518 ms
SECP384R1 Signature Fast High 31892872 498 ms
SECP384R1 Verification Small Low 92640888 1447 ms
SECP384R1 Verification Small High 80571880 1258 ms
SECP384R1 Verification Fast Low 78845888 1231 ms
SECP384R1 Verification Fast High 68981728 1077 ms
Cryptolib STM32G071 ECDSA Sig.svg
Cryptolib STM32G071 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 STM32G071 ECDSA SECP256R1 Sig FP.svg
Cryptolib STM32G071 ECDSA SECP256R1 Ver FP.svg
Cryptolib STM32G071 ECDSA SECP384R1 Sig FP.svg
Cryptolib STM32G071 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 17542344 274 ms
Ed25519 1023 bytes Signature Small OptHigh 10049208 157 ms
Ed25519 1023 bytes Signature SuperFast OptLow 13894560 217 ms
Ed25519 1023 bytes Signature SuperFast OptHigh 7847488 122 ms
Ed25519 1023 bytes Verification Small OptLow 27592888 431 ms
Ed25519 1023 bytes Verification Small OptHigh 24076144 376 ms
Ed25519 1023 bytes Verification SuperFast OptLow 21383760 334 ms
Ed25519 1023 bytes Verification SuperFast OptHigh 18260824 285 ms
Cryptolib STM32G071 EdDSA Sig.svg
Cryptolib STM32G071 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 STM32G071 EdDSA Sig FP.svg
Cryptolib STM32G071 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 1094400296 17100 ms
v2.2 CRT SHA-256 3K Signature Small Mid 832871456 13013 ms
v2.2 CRT SHA-256 3K Signature Small High 694549312 10852 ms
v2.2 CRT SHA-256 3K Signature Fast Low 922033912 14406 ms
v2.2 CRT SHA-256 3K Signature Fast Mid 664077128 10376 ms
v2.2 CRT SHA-256 3K Signature Fast High 551535136 8617 ms
v2.2 No CRT SHA-256 3K Signature Small Low 4309163808 67330 ms
v2.2 No CRT SHA-256 3K Signature Small Mid 3276559544 51196 ms
v2.2 No CRT SHA-256 3K Signature Small High 2722194536 42534 ms
v2.2 No CRT SHA-256 3K Signature Fast Low 3624891256 56638 ms
v2.2 No CRT SHA-256 3K Signature Fast Mid 2599467320 40616 ms
v2.2 No CRT SHA-256 3K Signature Fast High 2147945392 33561 ms
v2.2 n/a SHA-256 3K Verification Small n/a 17091112 267 ms
v2.2 n/a SHA-256 3K Verification Fast n/a 14019016 219 ms
Cryptolib STM32G071 RSA Sig.svg
Cryptolib STM32G071 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 370 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 369 bytes 5 bytes 708 bytes 3704 bytes
v2.2 CRT SHA-256 3K Signature Fast Mid 8376 bytes 369 bytes 5 bytes 708 bytes 4308 bytes
v2.2 CRT SHA-256 3K Signature Fast High 8376 bytes 369 bytes 5 bytes 708 bytes 6708 bytes
v2.2 No CRT SHA-256 3K Signature Small Low 6274 bytes 361 bytes 5 bytes 708 bytes 3484 bytes
v2.2 No CRT SHA-256 3K Signature Small Mid 6552 bytes 361 bytes 5 bytes 708 bytes 4664 bytes
v2.2 No CRT SHA-256 3K Signature Small High 6552 bytes 361 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 362 bytes 5 bytes 708 bytes 4664 bytes
v2.2 No CRT SHA-256 3K Signature Fast High 7390 bytes 362 bytes 5 bytes 708 bytes 9368 bytes
v2.2 n/a SHA-256 3K Verification Small n/a 7054 bytes 365 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 STM32G071 RSA 3K CRT Sig FP.svg
Cryptolib STM32G071 RSA 3K NoCRT Sig FP.svg
Cryptolib STM32G071 RSA 3K Ver FP.svg


No categories assignedEdit