Skip to content

Commit 221330d

Browse files
committed
Added introspection for Intel and ARM assembly speedups (useful for benchmarking output). Added STM32F439ZI benchmarks.
`--enable-armasm` : `Assembly Speedups: ARMASM ALIGN` `--enable-intelasm` : `Assembly Speedups: INTELASM ALIGN X86_64_BUILD`
1 parent fa9e122 commit 221330d

2 files changed

Lines changed: 137 additions & 0 deletions

File tree

IDE/STM32Cube/STM32_Benchmarks.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# STM Benchmarks
22

33
* [STM32F437](#stm32f437)
4+
* [STM32F439ZI](#stm32f439zi)
45
* [STM32F777](#stm32f777)
56
* [STM32G071RB](#stm32g071rb)
67
* [STM32H563ZI](#stm32h563zi)
@@ -679,6 +680,94 @@ Benchmark Test: Return code 0
679680
```
680681
681682
683+
## STM32F439ZI
684+
685+
Cortex-M4 at 168MHz (-Os)
686+
Using our software based ARM Assembly speedups (no hardware crypto)
687+
Tested on commit: fa9e122f1cca32513611f5a24de88d07aced015b
688+
689+
```c
690+
#define WOLFSSL_HAVE_SP_RSA
691+
#define WOLFSSL_HAVE_SP_DH
692+
#define WOLFSSL_HAVE_SP_ECC
693+
#define WOLFSSL_SP_ARM_CORTEX_M_ASM
694+
#define WOLFSSL_SP_SMALL
695+
#define SP_WORD_SIZE 32
696+
#define WOLFSSL_SP_384
697+
#define WOLFSSL_SP_521
698+
699+
#define GCM_TABLE_4BIT
700+
701+
#define HAVE_DILITHIUM
702+
#define WOLFSSL_WC_DILITHIUM
703+
#define WOLFSSL_DILITHIUM_SMALL
704+
705+
#define WOLFSSL_ARMASM
706+
#define WOLFSSL_ARMASM_INLINE
707+
#define WOLFSSL_ARMASM_NO_HW_CRYPTO
708+
#define WOLFSSL_ARMASM_NO_NEON
709+
#define WOLFSSL_ARMASM_THUMB2
710+
#define WOLFSSL_ARM_ARCH 7
711+
```
712+
713+
```
714+
wolfCrypt Benchmark (block bytes 1024, min 1.0 sec each)
715+
RNG 950 KiB took 1.004 seconds, 946.215 KiB/s
716+
AES-128-GCM-enc 1 MiB took 1.004 seconds, 1.046 MiB/s
717+
AES-128-GCM-dec 1 MiB took 1.004 seconds, 1.046 MiB/s
718+
AES-192-GCM-enc 975 KiB took 1.012 seconds, 963.439 KiB/s
719+
AES-192-GCM-dec 975 KiB took 1.016 seconds, 959.646 KiB/s
720+
AES-256-GCM-enc 875 KiB took 1.004 seconds, 871.514 KiB/s
721+
AES-256-GCM-dec 875 KiB took 1.004 seconds, 871.514 KiB/s
722+
AES-128-GCM-enc-no_AAD 1 MiB took 1.020 seconds, 1.053 MiB/s
723+
AES-128-GCM-dec-no_AAD 1 MiB took 1.020 seconds, 1.053 MiB/s
724+
AES-192-GCM-enc-no_AAD 975 KiB took 1.008 seconds, 967.262 KiB/s
725+
AES-192-GCM-dec-no_AAD 975 KiB took 1.007 seconds, 968.222 KiB/s
726+
AES-256-GCM-enc-no_AAD 900 KiB took 1.028 seconds, 875.486 KiB/s
727+
AES-256-GCM-dec-no_AAD 900 KiB took 1.024 seconds, 878.906 KiB/s
728+
GMAC Table 4-bit 3 MiB took 1.000 seconds, 2.502 MiB/s
729+
CHACHA 7 MiB took 1.000 seconds, 6.665 MiB/s
730+
CHA-POLY 4 MiB took 1.000 seconds, 4.248 MiB/s
731+
POLY1305 24 MiB took 1.000 seconds, 24.316 MiB/s
732+
SHA-256 3 MiB took 1.000 seconds, 2.637 MiB/s
733+
SHA3-224 1 MiB took 1.004 seconds, 0.997 MiB/s
734+
SHA3-256 975 KiB took 1.012 seconds, 963.439 KiB/s
735+
SHA3-384 750 KiB took 1.011 seconds, 741.840 KiB/s
736+
SHA3-512 525 KiB took 1.016 seconds, 516.732 KiB/s
737+
SHAKE128 1 MiB took 1.012 seconds, 1.158 MiB/s
738+
SHAKE256 975 KiB took 1.016 seconds, 959.646 KiB/s
739+
HMAC-SHA256 3 MiB took 1.004 seconds, 2.602 MiB/s
740+
RSA 2048 public 112 ops took 1.011 sec, avg 9.027 ms, 110.781 ops/sec
741+
RSA 2048 private 4 ops took 1.298 sec, avg 324.500 ms, 3.082 ops/sec
742+
DH 2048 key gen 7 ops took 1.149 sec, avg 164.143 ms, 6.092 ops/sec
743+
DH 2048 agree 8 ops took 1.314 sec, avg 164.250 ms, 6.088 ops/sec
744+
ML-KEM 512 128 key gen 248 ops took 1.000 sec, avg 4.032 ms, 248.000 ops/sec
745+
ML-KEM 512 128 encap 262 ops took 1.004 sec, avg 3.832 ms, 260.956 ops/sec
746+
ML-KEM 512 128 decap 198 ops took 1.004 sec, avg 5.071 ms, 197.211 ops/sec
747+
ML-KEM 768 192 key gen 154 ops took 1.004 sec, avg 6.519 ms, 153.386 ops/sec
748+
ML-KEM 768 192 encap 154 ops took 1.012 sec, avg 6.571 ms, 152.174 ops/sec
749+
ML-KEM 768 192 decap 120 ops took 1.000 sec, avg 8.333 ms, 120.000 ops/sec
750+
ML-KEM 1024 256 key gen 94 ops took 1.008 sec, avg 10.723 ms, 93.254 ops/sec
751+
ML-KEM 1024 256 encap 94 ops took 1.016 sec, avg 10.809 ms, 92.520 ops/sec
752+
ML-KEM 1024 256 decap 78 ops took 1.023 sec, avg 13.115 ms, 76.246 ops/sec
753+
ECC [ SECP256R1] 256 key gen 180 ops took 1.000 sec, avg 5.556 ms, 180.000 ops/sec
754+
ECDHE [ SECP256R1] 256 agree 86 ops took 1.012 sec, avg 11.767 ms, 84.980 ops/sec
755+
ECDSA [ SECP256R1] 256 sign 108 ops took 1.012 sec, avg 9.370 ms, 106.719 ops/sec
756+
ECDSA [ SECP256R1] 256 verify 60 ops took 1.008 sec, avg 16.800 ms, 59.524 ops/sec
757+
ML-DSA 44 key gen 52 ops took 1.011 sec, avg 19.442 ms, 51.434 ops/sec
758+
ML-DSA 44 sign 18 ops took 1.086 sec, avg 60.333 ms, 16.575 ops/sec
759+
ML-DSA 44 verify 46 ops took 1.008 sec, avg 21.913 ms, 45.635 ops/sec
760+
ML-DSA 65 key gen 30 ops took 1.035 sec, avg 34.500 ms, 28.986 ops/sec
761+
ML-DSA 65 sign 12 ops took 1.008 sec, avg 84.000 ms, 11.905 ops/sec
762+
ML-DSA 65 verify 28 ops took 1.027 sec, avg 36.679 ms, 27.264 ops/sec
763+
ML-DSA 87 key gen 18 ops took 1.051 sec, avg 58.389 ms, 17.127 ops/sec
764+
ML-DSA 87 sign 8 ops took 1.047 sec, avg 130.875 ms, 7.641 ops/sec
765+
ML-DSA 87 verify 16 ops took 1.000 sec, avg 62.500 ms, 16.000 ops/sec
766+
Benchmark complete
767+
Benchmark Test: Return code 0
768+
```
769+
770+
682771
## STM32L4A6Z
683772

684773
Supports RNG, AES-CBC/GCM and SHA-256 acceleration.

wolfcrypt/src/wolfmath.c

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,54 @@ const char *wc_GetMathInfo(void)
511511
" no-malloc"
512512
#endif
513513
#endif
514+
515+
/* ARM Assembly speedups */
516+
#if defined(WOLFSSL_ARMASM) || defined(USE_INTEL_SPEEDUP)
517+
"\n\tAssembly Speedups:"
518+
519+
#ifdef WOLFSSL_ARMASM
520+
" ARMASM"
521+
#ifdef WOLFSSL_ARMASM_THUMB2
522+
" THUMB2"
523+
#endif
524+
#ifdef WOLFSSL_ARMASM_INLINE
525+
" INLINE"
526+
#endif
527+
#ifdef WOLFSSL_ARMASM_NO_HW_CRYPTO
528+
" NO_HW_CRYPTO"
529+
#endif
530+
#ifdef WOLFSSL_ARMASM_NO_NEON
531+
" NO_NEON"
532+
#endif
533+
#ifdef WOLFSSL_ARM_ARCH
534+
" ARM ARCH=" WC_STRINGIFY(WOLFSSL_ARM_ARCH)
535+
#endif
536+
#endif
537+
538+
#ifdef USE_INTEL_SPEEDUP
539+
" INTELASM"
540+
#ifdef USE_INTEL_SPEEDUP_FOR_AES
541+
" AES"
542+
#endif
543+
#endif
544+
545+
#ifdef WOLFSSL_USE_ALIGN
546+
" ALIGN"
547+
#endif
548+
#ifdef HAVE_INTEL_RDRAND
549+
" INTEL_RDRAND"
550+
#endif
551+
#ifdef HAVE_AMD_RDSEED
552+
" AMD_RDSEED"
553+
#endif
554+
#ifdef WOLFSSL_X86_64_BUILD
555+
" X86_64_BUILD"
556+
#endif
557+
#ifdef WOLFSSL_X86_BUILD
558+
" X86_BUILD"
559+
#endif
560+
#endif
561+
514562
;
515563
}
516564
#endif /* HAVE_WC_INTROSPECTION */

0 commit comments

Comments
 (0)