1# Benchmark and comparison of OSCORE+EDHOC vs. (D)TLS
2
3## Flash
4
5| Platform             | uoscore-uedhoc 3.0.x | TLS 1.3     | DTLS 1.3    |
6| -------------------- | -------------------- | ----------- | ----------- |
7| nRF52840 (Cortex M4) | 41,156 Byte          | 52,023 Byte | 58,097 Byte |
8
9Notes:
10
111) uOSCORE-uEDHOC and (D)TLS are used with P256/AES-128-CCM and X509 certificates.
122) usocore-uedhoc uses [tinycrypt](https://github.com/intel/tinycrypt) as crypto engine for this evaluation and [zcbor](https://github.com/NordicSemiconductor/zcbor) as CBOR engine. The table shows the total footprint including tinycrypt and zcbor.
133) The (D)TLS data is obtained with [mbedTLS](https://github.com/Mbed-TLS/mbedtls) and published in Table II in  [Low-Power IoT Communication Security: On the Performance of DTLS and TLS 1.3](https://inria.hal.science/hal-03035402/document)
14
15## RAM
16
17| uoscore-uedhoc 3.0.x with FLA                 | uoscore-uedhoc 3.0.x with VLA                 | TLS 1.3    | DTLS 1.3   |
18| --------------------------------------------- | --------------------------------------------- | ---------- | ---------- |
19| 5639 Byte (initiator) / 6656 Byte (responder) | 5639 Byte (initiator) / 5351 Byte (responder) | 21692 Byte | 22026 Byte |
20
21Notes:
22
231. uOSCORE-uEDHOC uses only stack memory. The (D)TLS data includes stack and heap memory as given in Table V in [Low-Power IoT Communication Security: On the Performance of DTLS and TLS 1.3](https://inria.hal.science/hal-03035402/document)
24
25## Bytes-Over-Air
26
27| EDHOC                                                       | TLS 1.3 | DTLS 1.3 |
28| ----------------------------------------------------------- | ------- | -------- |
29| 808 Byte (exchanging two 293 Byte X.509 certificates)       | 1371    | 1500     |
30| 242 Byte (Using pre-established  X.509 certificates)        | -       | -        |
31| 101 Byte (Using pre-established static Diffie-Hellman keys) | -       | -        |
32
33## Latency
34
35### Latency for a key exchange with uEDHOC
36
37| Platform                    | EDHOC  exchanging X.509 certificates | EDHOC Using pre-established  X.509 certificates |
38| --------------------------- | ------------------------------------ | ----------------------------------------------- |
39| ESP32 (Xtensa LX6 @ 160MHz) | 0,402 s                              | 0,294 s                                         |
40| nRF52840 (Cortex M4 @64MHz) | 1,1735 s                             | 0,8615 s                                        |
41| nRF51822 (Cortex M0 @16MHz) | 11,7205 s                            | 8,622 s                                         |
42
43### Latency for encrypting/decrypting payload data with uOSCORE
44
45| Platform                    | Payload 20 Byte | Payload 50 Byte | Payload 100 Byte | Payload 200 Byte | Payload 500 Byte | Payload 1000 Byte |
46| --------------------------- | --------------- | --------------- | ---------------- | ---------------- | ---------------- | ----------------- |
47| ESP32 (Xtensa LX6 @ 160MHz) | 475 us          | 671 us          | 977 us           | 1585 us          | 3500 us          | 6600 us           |
48| nRF52840 (Cortex M4 @64MHz) | 1801 us         | 2533 us         | 3723 us          | 6073 us          | 13519 us         | 25665 us          |
49| nRF51822 (Cortex M0 @16MHz) | 9613 us         | 14069 us        | 20508 us         | 33356 us         | 74005 us         | 140381 us         |
50
51Notes:
52
531. All latency numbers are pure latency caused by computations. No data was send or received. The sending/receiving was emulated off-line.
542. [Tinycrypt](https://github.com/intel/tinycrypt) was used as cryptographic engine.
55