|
| 1 | +# wolfCrypt Benchmark Demo Application |
| 2 | + |
| 3 | +This demo application runs the wolfCrypt benchmark app. It benchmarks all |
| 4 | +algorithms enabled in wolfCrypt. It has been tested using a Raspberry Pi |
| 5 | +and SE050 EdgeLock development kit. |
| 6 | + |
| 7 | +## Building the Demo |
| 8 | + |
| 9 | +Before building this demo, follow initial setup instructions in the parent |
| 10 | +[README.md](../../README.md). |
| 11 | + |
| 12 | +**IMPORTANT:** This example requires the benchmark.c and benchmark.h files from |
| 13 | +a wolfSSL source package be copied into this directory before compiling and |
| 14 | +running the example. There are stub files included in this example directory |
| 15 | +that should be overwritten: |
| 16 | + |
| 17 | +``` |
| 18 | +$ cp wolfssl-X.X.X/wolfcrypt/benchmark/benchmark.c ./ |
| 19 | +$ cp wolfssl-X.X.X/wolfcrypt/benchmark/benchmark.h ./ |
| 20 | +``` |
| 21 | + |
| 22 | +Once this example directory has been copied into the SE05x middleware directory |
| 23 | +tree in the correct location, compiling the middleware will also compile this |
| 24 | +demo application: |
| 25 | + |
| 26 | +``` |
| 27 | +$ cd /home/pi/se_mw/simw-top_build/raspbian_native_se050_t1oi2c |
| 28 | +$ cmake --build . |
| 29 | +``` |
| 30 | + |
| 31 | +## Running the Demo |
| 32 | + |
| 33 | +To run the demo: |
| 34 | + |
| 35 | +``` |
| 36 | +$ cd /home/pi/se_mw/simw-top_build/raspbian_native_se050_t1oi2c/bin |
| 37 | +$ ./wolfcrypt_benchmark |
| 38 | +``` |
| 39 | + |
| 40 | +On successful run, output similar to the following will print out: |
| 41 | + |
| 42 | +``` |
| 43 | +App :INFO :PlugAndTrust_v04.02.00_20220524 |
| 44 | +App :INFO :Running ./wolfcrypt_benchmark |
| 45 | +App :INFO :If you want to over-ride the selection, use ENV=EX_SSS_BOOT_SSS_PORT or pass in command line arguments. |
| 46 | +sss :INFO :atr (Len=35) |
| 47 | + 00 A0 00 00 03 96 04 03 E8 00 FE 02 0B 03 E8 08 |
| 48 | + 01 00 00 00 00 64 00 00 0A 4A 43 4F 50 34 20 41 |
| 49 | + 54 50 4F |
| 50 | +sss :WARN :Communication channel is Plain. |
| 51 | +sss :WARN :!!!Not recommended for production use.!!! |
| 52 | +App :INFO :running setconfig |
| 53 | +App :INFO :Ran setconfig successfully |
| 54 | +wolfCrypt Benchmark (block bytes 1024, min 1.0 sec each) |
| 55 | +RNG 12 MiB took 1.001 seconds, 11.928 MiB/s |
| 56 | +AES-128-CBC-enc 20 MiB took 1.000 seconds, 19.724 MiB/s |
| 57 | +AES-128-CBC-dec 19 MiB took 1.001 seconds, 19.438 MiB/s |
| 58 | +AES-192-CBC-enc 17 MiB took 1.001 seconds, 16.982 MiB/s |
| 59 | +AES-192-CBC-dec 17 MiB took 1.001 seconds, 16.612 MiB/s |
| 60 | +AES-256-CBC-enc 15 MiB took 1.001 seconds, 14.755 MiB/s |
| 61 | +AES-256-CBC-dec 15 MiB took 1.001 seconds, 14.580 MiB/s |
| 62 | +AES-128-GCM-enc 10 MiB took 1.002 seconds, 9.967 MiB/s |
| 63 | +AES-128-GCM-dec 10 MiB took 1.002 seconds, 9.965 MiB/s |
| 64 | +AES-192-GCM-enc 9 MiB took 1.002 seconds, 9.208 MiB/s |
| 65 | +AES-192-GCM-dec 9 MiB took 1.000 seconds, 9.202 MiB/s |
| 66 | +AES-256-GCM-enc 8 MiB took 1.001 seconds, 8.492 MiB/s |
| 67 | +AES-256-GCM-dec 8 MiB took 1.000 seconds, 8.495 MiB/s |
| 68 | +AES-128-GCM-enc-no_AAD 10 MiB took 1.001 seconds, 9.975 MiB/s |
| 69 | +AES-128-GCM-dec-no_AAD 10 MiB took 1.002 seconds, 10.035 MiB/s |
| 70 | +AES-192-GCM-enc-no_AAD 9 MiB took 1.001 seconds, 9.269 MiB/s |
| 71 | +AES-192-GCM-dec-no_AAD 9 MiB took 1.002 seconds, 9.262 MiB/s |
| 72 | +AES-256-GCM-enc-no_AAD 9 MiB took 1.002 seconds, 8.554 MiB/s |
| 73 | +AES-256-GCM-dec-no_AAD 9 MiB took 1.003 seconds, 8.545 MiB/s |
| 74 | +GMAC Table 4-bit 22 MiB took 1.000 seconds, 21.581 MiB/s |
| 75 | +AES-128-ECB-enc 15 MiB took 1.000 seconds, 14.996 MiB/s |
| 76 | +AES-128-ECB-dec 15 MiB took 1.000 seconds, 14.983 MiB/s |
| 77 | +AES-192-ECB-enc 13 MiB took 1.000 seconds, 13.356 MiB/s |
| 78 | +AES-192-ECB-dec 13 MiB took 1.000 seconds, 13.240 MiB/s |
| 79 | +AES-256-ECB-enc 12 MiB took 1.000 seconds, 11.929 MiB/s |
| 80 | +AES-256-ECB-dec 12 MiB took 1.000 seconds, 11.921 MiB/s |
| 81 | +CHACHA 38 MiB took 1.000 seconds, 37.518 MiB/s |
| 82 | +CHA-POLY 26 MiB took 1.000 seconds, 26.211 MiB/s |
| 83 | +MD5 129 MiB took 1.000 seconds, 129.068 MiB/s |
| 84 | +POLY1305 118 MiB took 1.000 seconds, 118.446 MiB/s |
| 85 | +SHA 66 MiB took 1.000 seconds, 66.223 MiB/s |
| 86 | +SHA-256 31 MiB took 1.001 seconds, 31.328 MiB/s |
| 87 | +SHA-384 16 MiB took 1.000 seconds, 15.918 MiB/s |
| 88 | +SHA-512 16 MiB took 1.000 seconds, 15.914 MiB/s |
| 89 | +HMAC-MD5 127 MiB took 1.000 seconds, 126.965 MiB/s |
| 90 | +HMAC-SHA 65 MiB took 1.000 seconds, 65.453 MiB/s |
| 91 | +HMAC-SHA256 31 MiB took 1.001 seconds, 30.983 MiB/s |
| 92 | +HMAC-SHA384 16 MiB took 1.000 seconds, 15.551 MiB/s |
| 93 | +HMAC-SHA512 16 MiB took 1.001 seconds, 15.653 MiB/s |
| 94 | +PBKDF2 4 KiB took 1.002 seconds, 3.618 KiB/s |
| 95 | +sss :WARN :nxEnsure:'ret == SM_OK' failed. At Line:6971 Function:sss_se05x_TXn |
| 96 | +sss :WARN :Could not delete Key id FFFF |
| 97 | +sss :WARN :nxEnsure:'ret == SM_OK' failed. At Line:6971 Function:sss_se05x_TXn |
| 98 | +sss :WARN :Could not delete Key id 10000 |
| 99 | +RSA 1024 key gen 2 ops took 1.377 sec, avg 688.364 ms, 1.453 ops/sec |
| 100 | +sss :WARN :nxEnsure:'ret == SM_OK' failed. At Line:6971 Function:sss_se05x_TXn |
| 101 | +sss :WARN :Could not delete Key id 10001 |
| 102 | +RSA 2048 key gen 1 ops took 7.441 sec, avg 7440.538 ms, 0.134 ops/sec |
| 103 | +sss :WARN :nxEnsure:'ret == SM_OK' failed. At Line:6971 Function:sss_se05x_TXn |
| 104 | +sss :WARN :Could not delete Key id 10002 |
| 105 | +RSA 2048 public 10 ops took 1.133 sec, avg 113.271 ms, 8.828 ops/sec |
| 106 | +RSA 2048 private 6 ops took 1.278 sec, avg 212.942 ms, 4.696 ops/sec |
| 107 | +DH 2048 key gen 46 ops took 1.002 sec, avg 21.780 ms, 45.915 ops/sec |
| 108 | +DH 2048 agree 22 ops took 1.027 sec, avg 46.693 ms, 21.416 ops/sec |
| 109 | +sss :WARN :nxEnsure:'ret == SM_OK' failed. At Line:6971 Function:sss_se05x_TXn |
| 110 | +sss :WARN :Could not delete Key id 10003 |
| 111 | +sss :WARN :nxEnsure:'ret == SM_OK' failed. At Line:6971 Function:sss_se05x_TXn |
| 112 | +sss :WARN :Could not delete Key id 10004 |
| 113 | +sss :WARN :nxEnsure:'ret == SM_OK' failed. At Line:6971 Function:sss_se05x_TXn |
| 114 | +sss :WARN :Could not delete Key id 10005 |
| 115 | +sss :WARN :nxEnsure:'ret == SM_OK' failed. At Line:6971 Function:sss_se05x_TXn |
| 116 | +sss :WARN :Could not delete Key id 10006 |
| 117 | +ECC [ SECP256R1] 256 key gen 4 ops took 1.149 sec, avg 287.259 ms, 3.481 ops/sec |
| 118 | +sss :WARN :nxEnsure:'ret == SM_OK' failed. At Line:6971 Function:sss_se05x_TXn |
| 119 | +sss :WARN :Could not delete Key id 10007 |
| 120 | +sss :WARN :nxEnsure:'ret == SM_OK' failed. At Line:6971 Function:sss_se05x_TXn |
| 121 | +sss :WARN :Could not delete Key id 10008 |
| 122 | +sss :WARN :nxEnsure:'ret == SM_OK' failed. At Line:6971 Function:sss_se05x_TXn |
| 123 | +sss :WARN :Could not delete Key id 10009 |
| 124 | +sss :WARN :nxEnsure:'ret == SM_OK' failed. At Line:6971 Function:sss_se05x_TXn |
| 125 | +sss :WARN :Could not delete Key id 1000A |
| 126 | +sss :WARN :nxEnsure:'ret == SM_OK' failed. At Line:6971 Function:sss_se05x_TXn |
| 127 | +sss :WARN :Could not delete Key id 1000B |
| 128 | +sss :WARN :nxEnsure:'ret == SM_OK' failed. At Line:6971 Function:sss_se05x_TXn |
| 129 | +sss :WARN :Could not delete Key id 1000C |
| 130 | +ECDHE [ SECP256R1] 256 agree 4 ops took 1.710 sec, avg 427.612 ms, 2.339 ops/sec |
| 131 | +ECDSA [ SECP256R1] 256 sign 10 ops took 1.010 sec, avg 100.953 ms, 9.906 ops/sec |
| 132 | +ECDSA [ SECP256R1] 256 verify 10 ops took 1.010 sec, avg 100.998 ms, 9.901 ops/sec |
| 133 | +Benchmark complete |
| 134 | +``` |
| 135 | + |
| 136 | +## Demo Notes |
| 137 | + |
| 138 | +The `benchmark.c` and `benchmark.h` file in this directory have been copied |
| 139 | +directly from the wolfSSL download directory, at: |
| 140 | + |
| 141 | +``` |
| 142 | +wolfssl-X.X.X/wolfcrypt/benchmark/benchmark.c |
| 143 | +wolfssl-X.X.X/wolfcrypt/benchmark/benchmark.h |
| 144 | +``` |
| 145 | + |
0 commit comments