|
| 1 | +# Renesas RX72N EnvisionKit with Toppers OS |
| 2 | + |
| 3 | + |
| 4 | +This demonstration runs client, server, crypt test and benchmark exmples of <b>wolfSSL</b> with <b>Toppers OS</b> and <b>Renesas RX72N Envision Kit</b>. |
| 5 | + |
| 6 | + |
| 7 | +## Prerequisite |
| 8 | + |
| 9 | + |
| 10 | +1.Renesas e² studio Version: 2022-07 (22.7.0) or later |
| 11 | + |
| 12 | +2.Renesas e² studio BSP |
| 13 | + |
| 14 | +3.Toppers OS 1.9.1 (Patch RX72N version) |
| 15 | + |
| 16 | + |
| 17 | +|element|name/version| |
| 18 | +|:--|:--| |
| 19 | +|Renesas e² studio Version|GR-2022-07 (22.7.0) or later| |
| 20 | +|Toppers OS|1.9.3| |
| 21 | +|Toppers Configurator|1.9.6| |
| 22 | +|Renesas BSP r_bsp|7.10| |
| 23 | +|Renesas BSP r_cmt_rx|5.10| |
| 24 | + |
| 25 | + |
| 26 | +Note:The above version designations are limited to the versions used in order to make modifications to the designated versions as shown below. |
| 27 | + |
| 28 | +## Advance preparation |
| 29 | +Copy `wolfssl-examples/TOPPERS` to `wolfssl/IDE/Renesas/e2studio/RX72N/`. |
| 30 | + |
| 31 | +## Build libraries |
| 32 | +## 1. Build the wolfSSL library |
| 33 | +This step creates the Toppers and wolfSSL library. |
| 34 | + |
| 35 | +1-1. Press [Browse (R)] for [Select root directory (T)] in the [Import project] dialog |
| 36 | + |
| 37 | +1-2. Select `wolflib` from the git repository `wolfssl/IDE/Renesas/e2studio/RX72N/Toppers` Press [Select Folder] |
| 38 | + |
| 39 | +1-3. Click the created project in Project Explorer and select the [Build Project (B)] key from the pull-down menu to build. |
| 40 | + |
| 41 | +(When performing the above operations, make sure that [Toolchain:] is selected in the [Project] [Properties] [Settings] [toolchain] tab.) |
| 42 | + |
| 43 | +1-4. [libwolflib.a] is generated in [wolflib/Debug] |
| 44 | + |
| 45 | +## 2. Build TOPPERS library |
| 46 | +This step is to build the Toppers library. |
| 47 | + |
| 48 | +2-1. Download [asp-1.9.3 Renesas BSP version] (https://www.toppers.jp/asp-d-download.html) and unzip it to `/wolfssl/ IDE/Renesas/e2studio/RX72N/Toppers/` |
| 49 | + |
| 50 | +2-2. Download [Configurator Release 1.9.6 (binary for Windows)](https://www.toppers.jp/cfg-download.html) and unzip it with [2.1] Create a [cfg/cfg] directory in the [asp] directory. After extracting the zip, you can find `cfg.exe` in the folder. |
| 51 | + |
| 52 | +2-3. Execute the shell script shown below to apply the patch. Copy the files necessary for using EDMAC |
| 53 | + |
| 54 | +``` |
| 55 | +$ pwd [Individual installation environment]/wolfssl/IDE/Renesas/e2studio/RX72N/Toppers |
| 56 | +./setting.sh |
| 57 | +``` |
| 58 | + |
| 59 | +2-4. Confirmation of advance preparation |
| 60 | + |
| 61 | +a). Please prepare an environment such as Msys2 in advance for command execution. |
| 62 | + |
| 63 | +b). Install the gcc toolchain with Msys2. |
| 64 | + |
| 65 | +c). In the Msys2 environment, it is necessary to set the path of the Renesas environment in advance.bashrc etc. |
| 66 | + |
| 67 | +--- Here is a setting example: Specify the Renesas toolchain path --- |
| 68 | + |
| 69 | +``` |
| 70 | +$ export PATH=PATH=$PATH:\/C/ProgramData\/GCC\ for\ Renesas\ RX\ 8.3.0.202202-GNURX-ELF/rx-elf/rx-elf/bin |
| 71 | +``` |
| 72 | + |
| 73 | + |
| 74 | +2-5. To configure rx72n and make dependency, execute the following commands |
| 75 | + |
| 76 | +``` |
| 77 | +$ pwd [Individual installation environment]/wolfssl/IDE/Renesas/e2studio/RX72N/Toppers/asp |
| 78 | +$ perl ./configure -T rx72n_gcc |
| 79 | +$ make depend |
| 80 | +``` |
| 81 | + |
| 82 | +2-6. Project [Properties] → [C/C++ Build] → [Environment] dialog [Environment variable to set] [Add] button, enter [C_PROJECT] in [Name:] in [New variable] dialog , enter ${ProjDirPath} for [Value:] |
| 83 | + |
| 84 | +2-7. Select [Open Project from File System...] in the menu |
| 85 | + |
| 86 | +2-8. Select [Toppers_app] from the git repository wolfssl/IDE/Renesas/e2studio/RX72N/Toppers Press [Select Folder] |
| 87 | + |
| 88 | +2-9. Click the created project in Project Explorer and select the [Build Project (B)] key from the pull-down menu to build. |
| 89 | + |
| 90 | +2-10.[toppers_rx] will generate [libasp.a] |
| 91 | + |
| 92 | +## 3. Build the wolfSSLDemo project |
| 93 | + |
| 94 | +3-1. Select [Open Project from File System...] in the menu |
| 95 | + |
| 96 | +3-2. Select `WolfSSLDemo` from the git repository `wolfssl/IDE/Renesas/e2studio/RX72N/Toppers`. Press [Select Folder] |
| 97 | + |
| 98 | +3-3.Double-click `WolfSSLDemo.scfg` to display the setting dialog → Select [Components tab] |
| 99 | + |
| 100 | +3.4. Click [Generate Code] on the upper right of the [Software Component Dialog] dialog. |
| 101 | + |
| 102 | +3.5. Select [Startup] [r_bsp] in the component selection on the left side of the dialog Right-click, select [Change version] from the context menu, and confirm that [Current version] is [7.10] (not [7.10] If so, select [7.10] in [Version after change:] and press [Next (N) >] to generate the code) |
| 103 | + |
| 104 | +3-6. Select [Drivers] [r_cmt_rx] in the component selection on the left side of the dialog, right-click, select [Change version] from the context menu, and confirm that [Current version] is [5.10] ([5.10 If it is not ], select [5.10] in [Changed version:] and press [Next (N) >] to generate the code) |
| 105 | + |
| 106 | +3-7. Apply patch to work generated code on `TOPPERS` |
| 107 | + |
| 108 | +(If you cannot use the patch command with Msys2, you need to install it with [pacman -S patch]) do the following |
| 109 | + |
| 110 | +``` |
| 111 | +$pwd |
| 112 | +[Individual installation environment]/wolfssl/IDE/Renesas/e2studio/RX72N/Toppers/WolfSSLDemo |
| 113 | +$patch --binary -p0 < ./bsp.patch |
| 114 | +``` |
| 115 | + |
| 116 | +Note:<br> |
| 117 | +If you have used the smart configurator to generate code for [r_bsp],[r_cmt_rx], you will need to reapply the patch |
| 118 | + |
| 119 | +3-8. Select the [Build Project (B)] key from the pull-down menu to build. |
| 120 | + |
| 121 | +3-9. Transfer the ELF file generated by the build to the board with [Menu] → [Run (R)] → [Run (R)] or [Debug (D)] and execute it |
| 122 | + |
| 123 | +Note:<br> |
| 124 | +`T4_Library_ether_ccrx_rxv1_little` may be an error in the linker immediately after configuration/build Clear There is, but `T4_Library_ether_ccrx_rxv1_little`` from [Linker]/[Archives]/[User defined archive (library) files (-I)]/[×] in [Settings] of the [Properties] dialog [C/C++ Build] of the project. Please delete it. |
| 125 | + |
| 126 | +### 3-1 Run Server Program |
| 127 | + |
| 128 | +3-1-1. Enable `#define WOLFSSL_SERVER_TEST` in `wolf_demo.h`. IP addres will be assigned by DHCP. |
| 129 | + |
| 130 | +3-1-2. Check runtime message on `Renesas Debug Virtual Console` |
| 131 | + |
| 132 | +``` |
| 133 | +Start WolfSSL Demo !! |
| 134 | +Accept DHCP.ipaddr[4] 192.168.11.6 |
| 135 | +Accept DHCP.maskaddr[4] 255.255.255.0 |
| 136 | +Accept DHCP.gwaddr[4] 192.168.11.1 |
| 137 | +Accept DHCP.dnsaddr[4] 192.168.11.1 |
| 138 | +Accept DHCP.dnsaddr2[4] 0.0.0.0 |
| 139 | +Accept DHCP.macaddr[6] 74:90:50:10:FE:77 |
| 140 | +Accept DHCP.domain[0] |
| 141 | +
|
| 142 | +Start TLS Server |
| 143 | +
|
| 144 | +``` |
| 145 | + |
| 146 | +3-1-3. Run client program against to Server's IP address |
| 147 | + |
| 148 | +``` |
| 149 | +$ ./examples/client/client -h 192.168.11.6 -p 11111 |
| 150 | +SSL version is TLSv1.2 |
| 151 | +SSL cipher suite is TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 |
| 152 | +SSL curve name is SECP256R1 |
| 153 | +hello wolfssl! |
| 154 | +``` |
| 155 | + |
| 156 | +You would see the following messages on `Renesas Debug Virtual Console` when TLS connection between Server and Client is successful. |
| 157 | +``` |
| 158 | +Start TLS Server |
| 159 | +SSL Accept |
| 160 | +SSL Read |
| 161 | +Received Data: hello wolfssl! |
| 162 | +my_IOSend NG |
| 163 | +Start TLS Server |
| 164 | +``` |
| 165 | + |
| 166 | +### 3-2 Run Client Program |
| 167 | + |
| 168 | +3-2-1. Enable `#define WOLFSSL_CLIENT_TEST` in `wolf_demo.h`. IP addres will be assigned by DHCP. |
| 169 | + |
| 170 | +3-2-2. Server IP address and Port number are defined as `SERVER_IP` and `SERVER_PortNo` in `wolf_demo.h`. Change them if needed. |
| 171 | + |
| 172 | +3-2-3. Run Server program in advance |
| 173 | + |
| 174 | +``` |
| 175 | +$ ./examples/server/server -b -d -i -v 4 |
| 176 | +``` |
| 177 | + |
| 178 | +3-2-4. Run Client program from e2studio |
| 179 | + |
| 180 | +You would see the following messages on `Renesas Debug Virtual Console` when TLS connection between Client and Server is successful. The Client program repeatedly runs until it stops. |
| 181 | +``` |
| 182 | +Start WolfSSL Demo !! |
| 183 | +Accept DHCP.ipaddr[4] 192.168.11.6 |
| 184 | +Accept DHCP.maskaddr[4] 255.255.255.0 |
| 185 | +Accept DHCP.gwaddr[4] 192.168.11.1 |
| 186 | +Accept DHCP.dnsaddr[4] 192.168.11.1 |
| 187 | +Accept DHCP.dnsaddr2[4] 0.0.0.0 |
| 188 | +Accept DHCP.macaddr[6] 74:90:50:10:FE:77 |
| 189 | +Accept DHCP.domain[0] |
| 190 | +
|
| 191 | +Start TLS Client |
| 192 | +Received: I hear you fa shizzle! |
| 193 | +Start TLS Client |
| 194 | +Received: I hear you fa shizzle! |
| 195 | +Start TLS Client |
| 196 | +Received: I hear you fa shizzle! |
| 197 | +``` |
| 198 | +### 3-3 Run Crypt Test Program |
| 199 | + |
| 200 | +3-3-1. Enable `#define WOLFCRYPT_TEST` in `wolf_demo.h`. |
| 201 | + |
| 202 | +3-3-2. Run the program from e2studio and check the message on `Renesas Debug Virtual Consol` |
| 203 | + |
| 204 | +``` |
| 205 | +Start WolfSSL Demo !! |
| 206 | +
|
| 207 | +
|
| 208 | +Start wolfCrypt Test |
| 209 | +------------------------------------------------------------------------------ |
| 210 | +wolfSSL version 5.6.3 |
| 211 | +------------------------------------------------------------------------------ |
| 212 | +error test passed! |
| 213 | +MEMORY test passed! |
| 214 | +base64 test passed! |
| 215 | +asn test passed! |
| 216 | +RANDOM test passed! |
| 217 | +MD5 test passed! |
| 218 | +MD4 test passed! |
| 219 | +SHA test passed! |
| 220 | +SHA-256 test passed! |
| 221 | +SHA-384 test passed! |
| 222 | +SHA-512 test passed! |
| 223 | +SHA-512/224 test passed! |
| 224 | +SHA-512/256 test passed! |
| 225 | +Hash test passed! |
| 226 | +HMAC-MD5 test passed! |
| 227 | +HMAC-SHA test passed! |
| 228 | +HMAC-SHA256 test passed! |
| 229 | +HMAC-SHA384 test passed! |
| 230 | +HMAC-SHA512 test passed! |
| 231 | +HMAC-KDF test passed! |
| 232 | +TLSv1.3 KDF test passed! |
| 233 | +GMAC test passed! |
| 234 | +DES test passed! |
| 235 | +DES3 test passed! |
| 236 | +AES test passed! |
| 237 | +AES192 test passed! |
| 238 | +AES256 test passed! |
| 239 | +AES-GCM test passed! |
| 240 | +RSA test passed! |
| 241 | +DH test passed! |
| 242 | +DSA test passed! |
| 243 | +PWDBASED test passed! |
| 244 | +ECC test passed! |
| 245 | +ECC buffer test passed! |
| 246 | +CURVE25519 test passed! |
| 247 | +ED25519 test passed! |
| 248 | +logging test passed! |
| 249 | +time test passed! |
| 250 | +mutex test passed! |
| 251 | +memcb test passed! |
| 252 | +Test complete |
| 253 | +End wolfCrypt Test |
| 254 | +``` |
| 255 | + |
| 256 | +### 3-4 Run Benchmark program |
| 257 | + |
| 258 | +3-3-1. Enable `#define WOLF_BENCHMARK` in `wolf_demo.h`. |
| 259 | + |
| 260 | +3-3-2. Run the program from e2studio and check the message on `Renesas Debug Virtual Consol` |
| 261 | + |
| 262 | +``` |
| 263 | +Start WolfSSL Demo !! |
| 264 | +Start wolfCrypt Benchmark |
| 265 | +wolfCrypt Benchmark (block bytes 1024, min 1.0 sec each) |
| 266 | +RNG 275 KiB took 1.036 seconds, 265.444 KiB/s |
| 267 | +AES-128-CBC-enc 725 KiB took 1.017 seconds, 712.671 KiB/s |
| 268 | +AES-128-CBC-dec 700 KiB took 1.025 seconds, 682.727 KiB/s |
| 269 | +AES-192-CBC-enc 675 KiB took 1.006 seconds, 671.041 KiB/s |
| 270 | +AES-192-CBC-dec 650 KiB took 1.009 seconds, 644.266 KiB/s |
| 271 | +AES-256-CBC-enc 650 KiB took 1.024 seconds, 634.518 KiB/s |
| 272 | +AES-256-CBC-dec 625 KiB took 1.023 seconds, 610.709 KiB/s |
| 273 | +AES-128-GCM-enc 150 KiB took 1.040 seconds, 144.175 KiB/s |
| 274 | +AES-128-GCM-dec 150 KiB took 1.041 seconds, 144.134 KiB/s |
| 275 | +AES-192-GCM-enc 150 KiB took 1.054 seconds, 142.356 KiB/s |
| 276 | +AES-192-GCM-dec 150 KiB took 1.054 seconds, 142.315 KiB/s |
| 277 | +AES-256-GCM-enc 150 KiB took 1.067 seconds, 140.607 KiB/s |
| 278 | +AES-256-GCM-dec 150 KiB took 1.067 seconds, 140.581 KiB/s |
| 279 | +AES-128-GCM-enc-no_AAD 150 KiB took 1.028 seconds, 145.929 KiB/s |
| 280 | +AES-128-GCM-dec-no_AAD 150 KiB took 1.028 seconds, 145.886 KiB/s |
| 281 | +AES-192-GCM-enc-no_AAD 150 KiB took 1.041 seconds, 144.065 KiB/s |
| 282 | +AES-192-GCM-dec-no_AAD 150 KiB took 1.041 seconds, 144.023 KiB/s |
| 283 | +AES-256-GCM-enc-no_AAD 150 KiB took 1.054 seconds, 142.288 KiB/s |
| 284 | +AES-256-GCM-dec-no_AAD 150 KiB took 1.054 seconds, 142.248 KiB/s |
| 285 | +GMAC Default 184 KiB took 1.000 seconds, 183.963 KiB/s |
| 286 | +3DES 275 KiB took 1.016 seconds, 270.536 KiB/s |
| 287 | +MD5 5 MiB took 1.002 seconds, 4.900 MiB/s |
| 288 | +SHA 2 MiB took 1.013 seconds, 1.857 MiB/s |
| 289 | +SHA-256 625 KiB took 1.004 seconds, 622.634 KiB/s |
| 290 | +SHA-384 475 KiB took 1.011 seconds, 469.832 KiB/s |
| 291 | +SHA-512 475 KiB took 1.011 seconds, 469.832 KiB/s |
| 292 | +SHA-512/224 475 KiB took 1.011 seconds, 469.785 KiB/s |
| 293 | +SHA-512/256 475 KiB took 1.011 seconds, 469.785 KiB/s |
| 294 | +HMAC-MD5 5 MiB took 1.001 seconds, 4.855 MiB/s |
| 295 | +HMAC-SHA 2 MiB took 1.008 seconds, 1.841 MiB/s |
| 296 | +HMAC-SHA256 625 KiB took 1.012 seconds, 617.833 KiB/s |
| 297 | +HMAC-SHA384 475 KiB took 1.027 seconds, 462.512 KiB/s |
| 298 | +HMAC-SHA512 475 KiB took 1.027 seconds, 462.512 KiB/s |
| 299 | +PBKDF2 96 bytes took 1.232 seconds, 77.890 bytes/s |
| 300 | +RSA 2048 public 18 ops took 1.020 sec, avg 56.639 ms, 17.656 ops/sec |
| 301 | +RSA 2048 private 2 ops took 6.787 sec, avg 3393.650 ms, 0.295 ops/sec |
| 302 | +DH 2048 key gen 2 ops took 1.466 sec, avg 732.950 ms, 1.364 ops/sec |
| 303 | +DH 2048 agree 2 ops took 3.182 sec, avg 1590.800 ms, 0.629 ops/sec |
| 304 | +ECC [ SECP256R1] 256 key gen 4 ops took 1.704 sec, avg 425.875 ms, 2.348 ops/sec |
| 305 | +ECDHE [ SECP256R1] 256 agree 4 ops took 1.700 sec, avg 425.050 ms, 2.353 ops/sec |
| 306 | +ECDSA [ SECP256R1] 256 sign 4 ops took 1.716 sec, avg 429.050 ms, 2.331 ops/sec |
| 307 | +ECDSA [ SECP256R1] 256 verify 2 ops took 1.642 sec, avg 821.100 ms, 1.218 ops/sec |
| 308 | +CURVE 25519 key gen 2 ops took 1.343 sec, avg 671.700 ms, 1.489 ops/sec |
| 309 | +CURVE 25519 agree 2 ops took 1.342 sec, avg 670.900 ms, 1.491 ops/sec |
| 310 | +ED 25519 key gen 69 ops took 1.009 sec, avg 14.617 ms, 68.412 ops/sec |
| 311 | +ED 25519 sign 60 ops took 1.022 sec, avg 17.038 ms, 58.691 ops/sec |
| 312 | +ED 25519 verify 22 ops took 1.030 sec, avg 46.836 ms, 21.351 ops/sec |
| 313 | +Benchmark complete |
| 314 | +End wolfCrypt Benchmark |
| 315 | +``` |
0 commit comments