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

Add SHA512/224 and SHA512/256 benchmarks #6113

Merged
merged 4 commits into from
Feb 21, 2023

Conversation

gojimmypi
Copy link
Contributor

Description

To accompany the new SHA-512/224 and SHA-512/256 tests in #6097 this PR adds the respective benchmarks.

Fixes zd# n/a

Testing

Tested in both Espressif wolfssl_test and Espressif wolfssl_benchmark examples, as well as:

./configure CC=clang --enable-trackmemory CFLAGS=-DHAVE_STACK_SIZE && make && ./wolfcrypt/benchmark/benchmark

This result on windows 10 WSL on my Intel(R) Core(TM) i7-9700 CPU @ 3.00GHz, 32.0 GB RAM 64-bit operating system:

------------------------------------------------------------------------------
 wolfSSL version 5.5.4
------------------------------------------------------------------------------
wolfCrypt Benchmark (block bytes 1048576, min 1.0 sec each)
RNG                        126 MB took 1.022 seconds,  123.089 MB/s Cycles per byte =  24.37
AES-128-CBC-enc            320 MB took 1.007 seconds,  317.540 MB/s Cycles per byte =   9.45
AES-128-CBC-dec            315 MB took 1.011 seconds,  311.032 MB/s Cycles per byte =   9.65
AES-192-CBC-enc            273 MB took 1.012 seconds,  269.433 MB/s Cycles per byte =  11.13
AES-192-CBC-dec            267 MB took 1.009 seconds,  265.125 MB/s Cycles per byte =  11.32
AES-256-CBC-enc            236 MB took 1.005 seconds,  234.649 MB/s Cycles per byte =  12.79
AES-256-CBC-dec            236 MB took 1.014 seconds,  232.716 MB/s Cycles per byte =  12.89
AES-128-GCM-enc            173 MB took 1.017 seconds,  170.115 MB/s Cycles per byte =  17.64
AES-128-GCM-dec            173 MB took 1.009 seconds,  171.490 MB/s Cycles per byte =  17.49
AES-192-GCM-enc            157 MB took 1.003 seconds,  156.889 MB/s Cycles per byte =  19.12
AES-192-GCM-dec            157 MB took 1.005 seconds,  156.469 MB/s Cycles per byte =  19.17
AES-256-GCM-enc            147 MB took 1.017 seconds,  144.332 MB/s Cycles per byte =  20.79
AES-256-GCM-dec            147 MB took 1.019 seconds,  144.001 MB/s Cycles per byte =  20.83
GMAC Table 4-bit           392 MB took 1.003 seconds,  391.175 MB/s Cycles per byte =   7.67
CHACHA                     446 MB took 1.005 seconds,  443.327 MB/s Cycles per byte =   6.77
CHA-POLY                   357 MB took 1.009 seconds,  353.497 MB/s Cycles per byte =   8.49
MD5                        624 MB took 1.005 seconds,  621.092 MB/s Cycles per byte =   4.83
POLY1305                  1704 MB took 1.001 seconds, 1702.525 MB/s Cycles per byte =   1.76
SHA                        577 MB took 1.007 seconds,  572.954 MB/s Cycles per byte =   5.24
SHA-224                    267 MB took 1.001 seconds,  267.158 MB/s Cycles per byte =  11.23
SHA-256                    273 MB took 1.015 seconds,  268.473 MB/s Cycles per byte =  11.17
SHA-384                    383 MB took 1.005 seconds,  380.768 MB/s Cycles per byte =   7.88
SHA-512                    388 MB took 1.007 seconds,  385.113 MB/s Cycles per byte =   7.79
SHA-512/224                383 MB took 1.006 seconds,  380.320 MB/s Cycles per byte =   7.89
SHA-512/256                388 MB took 1.007 seconds,  385.279 MB/s Cycles per byte =   7.79
SHA3-224                   346 MB took 1.005 seconds,  344.443 MB/s Cycles per byte =   8.71
SHA3-256                   330 MB took 1.006 seconds,  328.306 MB/s Cycles per byte =   9.14
SHA3-384                   241 MB took 1.006 seconds,  239.823 MB/s Cycles per byte =  12.51
SHA3-512                   173 MB took 1.011 seconds,  171.072 MB/s Cycles per byte =  17.54
HMAC-MD5                   613 MB took 1.004 seconds,  610.896 MB/s Cycles per byte =   4.91
HMAC-SHA                   556 MB took 1.001 seconds,  555.426 MB/s Cycles per byte =   5.40
HMAC-SHA224                267 MB took 1.010 seconds,  264.664 MB/s Cycles per byte =  11.34
HMAC-SHA256                267 MB took 1.003 seconds,  266.702 MB/s Cycles per byte =  11.25
HMAC-SHA384                383 MB took 1.005 seconds,  380.944 MB/s Cycles per byte =   7.88
HMAC-SHA512                367 MB took 1.005 seconds,  365.336 MB/s Cycles per byte =   8.21
PBKDF2                      29 KB took 1.000 seconds,   28.989 KB/s Cycles per byte = 103488.81
RSA     2048   public     25800 ops took 1.002 sec, avg 0.039 ms, 25744.035 ops/sec
RSA     2048  private       500 ops took 1.231 sec, avg 2.463 ms, 406.079 ops/sec
DH      2048  key gen      2207 ops took 1.000 sec, avg 0.453 ms, 2206.466 ops/sec
DH      2048    agree      1100 ops took 1.100 sec, avg 1.000 ms, 1000.307 ops/sec
ECC   [      SECP256R1]   256  key gen      2500 ops took 1.011 sec, avg 0.405 ms, 2472.081 ops/sec
ECDHE [      SECP256R1]   256    agree      2500 ops took 1.009 sec, avg 0.404 ms, 2477.727 ops/sec
ECDSA [      SECP256R1]   256     sign      2400 ops took 1.003 sec, avg 0.418 ms, 2392.450 ops/sec
ECDSA [      SECP256R1]   256   verify      3600 ops took 1.021 sec, avg 0.284 ms, 3524.550 ops/sec
Benchmark complete
total   Allocs   =    109516
total   Deallocs =    109516
total   Bytes    = 321727184
peak    Bytes    =   2154026
current Bytes    =         0
stack used = 2097152

Checklist

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

@dgarske dgarske merged commit 821120e into wolfSSL:master Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants