sfinx

sphincs+ inspired signing utility
git clone git://git.finwo.net/app/sfinx
Log | Files | Refs | README | LICENSE

bench.md (5120B)


      1 Benchmarks
      2 ==========
      3 
      4 Operations per second, higher is better. Tree mode at path length 32, so one
      5 signature covers 32 subtrees.
      6 
      7 | host                      | cores | backend  |
      8 | ------------------------- | ----- | -------- |
      9 | AMD Ryzen 7 9800X3D       | 8/16  | avx512   |
     10 | Intel Xeon D-1541         | 8/16  | avx2     |
     11 | Cortex-A520 + A720        | 12    | arm-sha3 |
     12 
     13 gcc 14.2.1, `-Wall -Wextra -O2`, best of 5 on the Ryzen, 3 on the Xeon, 2 on
     14 the ARM. The Xeon shares its host with other services, so treat it as a floor.
     15 
     16 Only keygen and signing use the worker pool. Verifying and single mode run on
     17 one core either way, so they are listed once.
     18 
     19 ## SHA3-256, the default
     20 
     21 | host          | keygen/s | sign/s | verify/s |
     22 | ------------- | -------- | ------ | -------- |
     23 | 9800X3D       |       18 |   0.56 |       40 |
     24 | 9800X3D x16   |      186 |   4.72 |       40 |
     25 | D-1541        |      2.0 |  0.063 |       12 |
     26 | D-1541 x16    |       15 |   0.49 |       12 |
     27 | A520/A720     |      1.1 |  0.034 |      8.0 |
     28 | A520/A720 x12 |      7.0 |   0.21 |      8.0 |
     29 
     30 ## Every hash size
     31 
     32 Single core, then the same host threaded.
     33 
     34 | host          | hash     | keygen/s | sign/s | verify/s |
     35 | ------------- | -------- | -------- | ------ | -------- |
     36 | 9800X3D       | SHA3-224 |       20 |   0.63 |       43 |
     37 | 9800X3D       | SHA3-256 |       18 |   0.56 |       40 |
     38 | 9800X3D       | SHA3-384 |       12 |   0.38 |       26 |
     39 | 9800X3D       | SHA3-512 |      9.4 |   0.29 |       20 |
     40 | 9800X3D x16   | SHA3-224 |      208 |   5.38 |       43 |
     41 | 9800X3D x16   | SHA3-256 |      186 |   4.72 |       40 |
     42 | 9800X3D x16   | SHA3-384 |      125 |   3.14 |       25 |
     43 | 9800X3D x16   | SHA3-512 |       96 |   2.30 |       20 |
     44 | D-1541        | SHA3-224 |      2.3 |  0.071 |       13 |
     45 | D-1541        | SHA3-256 |      2.0 |  0.063 |       12 |
     46 | D-1541        | SHA3-384 |      1.4 |  0.043 |      7.8 |
     47 | D-1541        | SHA3-512 |      1.0 |  0.032 |      6.2 |
     48 | D-1541 x16    | SHA3-224 |       17 |   0.57 |       13 |
     49 | D-1541 x16    | SHA3-256 |       15 |   0.49 |       12 |
     50 | D-1541 x16    | SHA3-384 |       10 |   0.34 |      8.0 |
     51 | D-1541 x16    | SHA3-512 |      7.2 |   0.25 |      6.2 |
     52 | A520/A720     | SHA3-224 |      1.2 |  0.038 |      8.8 |
     53 | A520/A720     | SHA3-256 |      1.1 |  0.034 |      8.0 |
     54 | A520/A720     | SHA3-384 |     0.49 |  0.015 |      3.5 |
     55 | A520/A720     | SHA3-512 |     0.55 |  0.017 |      4.1 |
     56 | A520/A720 x12 | SHA3-224 |      7.7 |   0.23 |      8.8 |
     57 | A520/A720 x12 | SHA3-256 |      7.0 |   0.21 |      8.0 |
     58 | A520/A720 x12 | SHA3-384 |      4.9 |   0.14 |      5.2 |
     59 | A520/A720 x12 | SHA3-512 |      3.8 |   0.11 |      4.1 |
     60 
     61 ## Single mode
     62 
     63 One WOTS key, no tree, no path. Signs and verifies on one core.
     64 
     65 | host      | SHA3-224 | SHA3-256 | SHA3-384 | SHA3-512 |
     66 | --------- | -------- | -------- | -------- | -------- |
     67 | 9800X3D   |     1395 |     1303 |     1055 |      626 |
     68 | D-1541    |      453 |      424 |      315 |      197 |
     69 | A520/A720 |      283 |      262 |      142 |      126 |
     70 
     71 ## Chains
     72 
     73 `make --directory test bench-chain`, one subtree of chains advanced 256 steps,
     74 in millions of hashes per second on the 9800X3D. Higher is better.
     75 
     76 - `plain`: an untweaked chain over the batch API
     77 - `glue`: the tweak over the batch API, rebuilding records each step
     78 - `fused`: the chain kernel
     79 
     80 | hash     | backend    | plain | glue  | fused |
     81 | -------- | ---------- | ----- | ----- | ----- |
     82 | SHA3-224 | scalar     |  5.14 |  4.98 |  5.11 |
     83 | SHA3-224 | scalar+bmi |  5.92 |  5.70 |  5.84 |
     84 | SHA3-224 | avx2 x4    | 11.81 | 10.77 | 13.43 |
     85 | SHA3-224 | avx512 x8  | 26.13 | 22.13 | 39.83 |
     86 | SHA3-256 | scalar     |  5.14 |  4.97 |  5.10 |
     87 | SHA3-256 | scalar+bmi |  5.91 |  5.66 |  5.86 |
     88 | SHA3-256 | avx2 x4    | 11.74 | 10.64 | 13.50 |
     89 | SHA3-256 | avx512 x8  | 25.68 | 21.42 | 40.35 |
     90 | SHA3-384 | scalar     |  5.11 |  4.83 |  5.13 |
     91 | SHA3-384 | scalar+bmi |  5.83 |  5.45 |  5.86 |
     92 | SHA3-384 | avx2 x4    | 11.20 |  9.56 | 13.53 |
     93 | SHA3-384 | avx512 x8  | 23.99 | 17.35 | 40.21 |
     94 | SHA3-512 | scalar     |  5.02 |  4.94 |  5.14 |
     95 | SHA3-512 | scalar+bmi |  5.70 |  5.60 |  5.85 |
     96 | SHA3-512 | avx2 x4    | 10.92 | 10.50 | 13.59 |
     97 | SHA3-512 | avx512 x8  | 22.33 | 20.79 | 40.90 |
     98 
     99 A chain step is one permutation at every hash size, so the fused kernel holds
    100 about 40 Mh/s on avx512 from SHA3-224 to SHA3-512, where an untweaked chain
    101 falls from 26.1 to 22.3. Reaching the chain through the batch API instead costs
    102 a transpose and a scalar absorb per step, which is the `glue` column.
    103 
    104 The scalar rows have one lane, so the batch API has nothing to overlap and its
    105 `plain` column lands on the same one-permutation loop as `fused`. `scalar+bmi`
    106 is the fallback on x86 without AVX, about 15% ahead.
    107 
    108 ## Notes
    109 
    110 Signing scales with path length: at path 32 each signature builds 32 subtrees,
    111 and a shorter path is proportionally faster. Verifying does not, since it only
    112 walks the path it is given.
    113 
    114 Zen 5 has a full-width AVX-512 datapath. Intel parts that double-pump 512-bit
    115 operations will sit closer to the avx2 numbers.