Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added benchmark script, enabled ARMASM for Cortex-M3,4,7,33 #513

Merged
merged 3 commits into from
Oct 25, 2024

Conversation

danielinux
Copy link
Member

Adds a benchmark.sh script to compare ciphers & options over footprint, runtime memory, boot time.

Example output (in .md format): STM32H7 at 320MHz with ~100KB application image:

Name Configuration Bootloader size Stack size Image header size Boot time
SHA2 only SIGN=NONE 8776 1216 256 .388
SHA384 only SIGN=NONE HASH=SHA384 18048 3760 256 .690
SHA3 only SIGN=NONE HASH=SHA3 8472 1216 256 1.142
SHA2 only,small SIGN=NONE NO_ASM=1 5564 1216 256 .475
rsa2048 SIGN=RSA2048 15176 17568 512 .518
rsa3072 SIGN=RSA3072 15316 12288 512 .670
rsa4096 SIGN=RSA4096 15460 18064 1024 .866
rsa4096 with sha384 SIGN=RSA4096 HASH=SHA384 24796 18064 1024 1.170
ecdsa256 SIGN=ECC256 21836 7632 256 .584
ecdsa384 SIGN=ECC384 21428 11216 512 2.535
ecdsa521 SIGN=ECC521 25104 8288 512 3.750
ecdsa256 with small stack SIGN=ECC384 WOLFBOOT_SMALL_STACK=1 22184 5880 512 2.553
ecdsa256 with fast math SIGN=ECC384 SP_MATH=0 21428 11216 512 2.535
ecdsa256, no asm SIGN=ECC256 NO_ASM=1 14416 7632 256 3.347
ecdsa384, no asm SIGN=ECC384 NO_ASM=1 15900 11216 512 11.516
ecdsa521, no asm SIGN=ECC521 NO_ASM=1 14652 8288 512 25.735
ecdsa384 with sha384 SIGN=ECC384 HASH=SHA384 30704 11216 512 2.840
ed25519 with sha384, small SIGN=ED25519 HASH=SHA384 NO_ASM=1 10976 5000 256 10.059
ed25519 fast SIGN=ED25519 NO_ASM=0 27684 5000 256 9.242
ed448 SIGN=ED448 17432 4578 512 42.172
ML_DSA-44 SIGN=ML_DSA ML_DSA_LEVEL=2 IMAGE_SIGNATURE_SIZE=2420 IMAGE_HEADER_SIZE=8192 19520 19544 8192 .585
ML_DSA-65 SIGN=ML_DSA ML_DSA_LEVEL=3 IMAGE_SIGNATURE_SIZE=3309 IMAGE_HEADER_SIZE=8192 20160 19544 8192 .693
ML_DSA-87 SIGN=ML_DSA ML_DSA_LEVEL=5 IMAGE_SIGNATURE_SIZE=4627 IMAGE_HEADER_SIZE=12288 20800 19544 12288 .871
LMS 1-10-8 SIGN=LMS LMS_LEVELS=1 LMS_HEIGHT=10 LMS_WINTERNITZ=8 IMAGE_HEADER_SIZE=4096 IMAGE_SIGNATURE_SIZE=1456 11460 1320 4096 1.398
XMSS-SHA2_10_256' XMSS_PARAMS=XMSS-SHA2_10_256 SIGN=XMSS IMAGE_SIGNATURE_SIZE=2500 IMAGE_HEADER_SIZE=8192 26952 9352 8192 1.205

@dgarske
Copy link
Contributor

dgarske commented Oct 23, 2024

@danielinux wow! Hands-clapping!

@danielinux danielinux self-assigned this Oct 23, 2024
arch.mk Outdated
ifneq ($(NO_ARM_ASM),1)
CORTEXM_ARM_EXTRA_OBJS= \
./lib/wolfssl/wolfcrypt/src/port/arm/armv8-aes.o \
./lib/wolfssl/wolfcrypt/src/port/arm/armv8-chacha.o \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tabs vs spaces? Looks like a few places

docs/compile.md Outdated
@@ -42,6 +42,28 @@ By default, wolfBoot is compiled for ARM Cortex-M3/4/7. To compile for Cortex-M0

`CORTEX_M0=1`

### Speed vs. size

On a number of targets, algorithm may be optimized automatically to use assembly
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"On a number of targets, algorithm may be optimized automatically to use assembly
optimizations." -> "Some targets support assembly optiomizations by default."?

@@ -0,0 +1,98 @@
#!/bin/bash
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you planning to publish the benchmark.sh results in a CI job like the markdown you posted in the PR description?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that's the plan. Currently busy rebuilding my on-site infrastracture, I will eventually provide a dedicated jenkins node to run the benchmark.

@dgarske dgarske merged commit 787a21b into wolfSSL:master Oct 25, 2024
99 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants