Skip to content

Conversation

@SparkiDev
Copy link
Contributor

Description

Added million of cycles per op information.
Getting cycle count for Aarch64 now too.

Testing

Inte x64l and Aarch64 emulator.

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@SparkiDev SparkiDev self-assigned this Oct 16, 2025
@devin-ai-integration
Copy link
Contributor

🛟 Devin Lifeguard found 1 likely issues in this PR

  • check-all-return-codes snippet: Verify whether ignoring the XSNPRINTF return value is acceptable in this codebase; if not, store the return value from XSNPRINTF in an int and handle negatives or length overflows accordingly in the new SHOW_*_CYCLES_OPS macros.

@SparkiDev
please take a look at the above issues which Devin flagged. Devin will not fix these issues automatically.

@SparkiDev SparkiDev force-pushed the benchmark_asym_cc branch 4 times, most recently from 7ab8522 to 2d1cdaf Compare October 21, 2025 02:50
@SparkiDev SparkiDev assigned wolfSSL-Bot and unassigned SparkiDev Oct 21, 2025
@SparkiDev SparkiDev requested a review from wolfSSL-Bot October 21, 2025 03:48
dgarske
dgarske previously approved these changes Oct 21, 2025
Copy link
Contributor

@dgarske dgarske left a comment

Choose a reason for hiding this comment

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

I resolved the merge conflict tested and approve.

Copy link
Contributor

@JacobBarthelmeh JacobBarthelmeh left a comment

Choose a reason for hiding this comment

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

The cycles per byte calculation seems off. What I see on the Linaro node:

./configure --enable-armasm --enable-sp --enable-sp-asm && make


------------------------------------------------------------------------------
 wolfSSL version 5.8.2
------------------------------------------------------------------------------
Math: 	Multi-Precision: Wolf(SP) word-size=64 bits=4096 sp_int.c
	Single Precision: ecc 256 384 521 rsa/dh 2048 3072 4096 asm sp_arm64.c
	Assembly Speedups: ARMASM ALIGN
wolfCrypt Benchmark (block bytes 1048576, min 1.0 sec each)
RNG                         85 MiB took 1.048 seconds,   81.094 MiB/s Cycles per byte =   0.01
AES-128-CBC-enc            650 MiB took 1.007 seconds,  645.666 MiB/s Cycles per byte =   0.00
AES-128-CBC-dec            605 MiB took 1.002 seconds,  603.849 MiB/s Cycles per byte =   0.00
AES-192-CBC-enc            570 MiB took 1.006 seconds,  566.793 MiB/s Cycles per byte =   0.00
AES-192-CBC-dec            550 MiB took 1.002 seconds,  548.960 MiB/s Cycles per byte =   0.00
AES-256-CBC-enc            505 MiB took 1.006 seconds,  502.021 MiB/s Cycles per byte =   0.00
AES-256-CBC-dec            495 MiB took 1.008 seconds,  490.868 MiB/s Cycles per byte =   0.00
AES-128-GCM-enc            555 MiB took 1.006 seconds,  551.961 MiB/s Cycles per byte =   0.00
AES-128-GCM-dec            555 MiB took 1.004 seconds,  552.964 MiB/s Cycles per byte =   0.00
AES-192-GCM-enc            515 MiB took 1.005 seconds,  512.671 MiB/s Cycles per byte =   0.00
AES-192-GCM-dec            515 MiB took 1.005 seconds,  512.650 MiB/s Cycles per byte =   0.00
AES-256-GCM-enc            485 MiB took 1.007 seconds,  481.773 MiB/s Cycles per byte =   0.00
AES-256-GCM-dec            485 MiB took 1.008 seconds,  481.231 MiB/s Cycles per byte =   0.00
GMAC Table 4-bit          1012 MiB took 1.000 seconds, 1011.610 MiB/s Cycles per byte =   0.00
CHACHA                     260 MiB took 1.010 seconds,  257.478 MiB/s Cycles per byte =   0.00
CHA-POLY                   175 MiB took 1.002 seconds,  174.628 MiB/s Cycles per byte =   0.01
POLY1305                   530 MiB took 1.006 seconds,  526.602 MiB/s Cycles per byte =   0.00
SHA                        110 MiB took 1.032 seconds,  106.555 MiB/s Cycles per byte =   0.01
SHA-224                    525 MiB took 1.000 seconds,  524.798 MiB/s Cycles per byte =   0.00
SHA-256                    525 MiB took 1.003 seconds,  523.473 MiB/s Cycles per byte =   0.00
SHA-384                    125 MiB took 1.022 seconds,  122.336 MiB/s Cycles per byte =   0.01
SHA-512                    125 MiB took 1.023 seconds,  122.210 MiB/s Cycles per byte =   0.01
SHA-512/224                125 MiB took 1.022 seconds,  122.290 MiB/s Cycles per byte =   0.01
SHA-512/256                125 MiB took 1.020 seconds,  122.555 MiB/s Cycles per byte =   0.01
SHA3-224                    85 MiB took 1.037 seconds,   82.000 MiB/s Cycles per byte =   0.01
SHA3-256                    80 MiB took 1.029 seconds,   77.765 MiB/s Cycles per byte =   0.01
SHA3-384                    65 MiB took 1.076 seconds,   60.427 MiB/s Cycles per byte =   0.02
SHA3-512                    45 MiB took 1.053 seconds,   42.734 MiB/s Cycles per byte =   0.03
HMAC-SHA                   110 MiB took 1.035 seconds,  106.322 MiB/s Cycles per byte =   0.01
HMAC-SHA224                525 MiB took 1.006 seconds,  521.686 MiB/s Cycles per byte =   0.00
HMAC-SHA256                530 MiB took 1.005 seconds,  527.105 MiB/s Cycles per byte =   0.00
HMAC-SHA384                125 MiB took 1.021 seconds,  122.440 MiB/s Cycles per byte =   0.01
HMAC-SHA512                125 MiB took 1.021 seconds,  122.459 MiB/s Cycles per byte =   0.01
PBKDF2                      30 KiB took 1.001 seconds,   29.855 KiB/s Cycles per byte =  39.25
RSA     2048   public      4300 ops took 1.019 sec, avg 0.237 ms,  4218.856 ops/sec, 1223080 cycles      284.4 Cycles/op
RSA     2048  private       200 ops took 1.747 sec, avg 8.733 ms,   114.508 ops/sec, 2095926 cycles    10479.6 Cycles/op
DH      2048  key gen       232 ops took 1.000 sec, avg 4.311 ms,   231.969 ops/sec, 1200162 cycles     5173.1 Cycles/op
DH      2048    agree       300 ops took 1.292 sec, avg 4.308 ms,   232.117 ops/sec, 1550939 cycles     5169.8 Cycles/op
ECC   [      SECP256R1]   256  key gen      7200 ops took 1.006 sec, avg 0.140 ms,  7158.320 ops/sec, 1206986 cycles      167.6 Cycles/op
ECDHE [      SECP256R1]   256    agree      1900 ops took 1.003 sec, avg 0.528 ms,  1894.778 ops/sec, 1203307 cycles      633.3 Cycles/op
ECDSA [      SECP256R1]   256     sign      4800 ops took 1.018 sec, avg 0.212 ms,  4713.935 ops/sec, 1221909 cycles      254.6 Cycles/op
ECDSA [      SECP256R1]   256   verify      1800 ops took 1.011 sec, avg 0.562 ms,  1780.586 ops/sec, 1213084 cycles      673.9 Cycles/op
Benchmark complete

A 0.01 cycle per byte would be blazingly fast.

@SparkiDev SparkiDev force-pushed the benchmark_asym_cc branch 2 times, most recently from 7e2e00f to c3b9b32 Compare October 21, 2025 21:54
@anhu
Copy link
Member

anhu commented Oct 21, 2025

It just so happens that this was requested in ZD 20619.

@SparkiDev SparkiDev force-pushed the benchmark_asym_cc branch 7 times, most recently from 7d96b09 to b6bd332 Compare October 22, 2025 01:09
@SparkiDev
Copy link
Contributor Author

Can't get the real frequency so I've put the clock frequency into the header and allowed the setting of actual frequency with -freq for Aarch64 only.

@SparkiDev
Copy link
Contributor Author

retest this please

fipsv2:
�[1;38;5;243mdid NOT clone wolfSSL�[0m
R_VER = 5.8.2
�[1;32mRUNNING: run_checkout 432b-v2�[0m

@JacobBarthelmeh
Copy link
Contributor

I'm still seeing some issue with using -freq. Sent a private note, maybe I am building incorrectly for collecting cycles/byte ?

@SparkiDev SparkiDev force-pushed the benchmark_asym_cc branch 2 times, most recently from f172db7 to 34dc8b2 Compare October 22, 2025 22:41
Added million of cycles per op information.
Getting cycle count for Aarch64 now too.
@SparkiDev
Copy link
Contributor Author

retest this please

PRB tests aborted

Copy link
Contributor

@JacobBarthelmeh JacobBarthelmeh left a comment

Choose a reason for hiding this comment

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

Worked for me now when setting the -freq argument.

@JacobBarthelmeh JacobBarthelmeh merged commit 7f5d02c into wolfSSL:master Oct 23, 2025
259 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.

5 participants