diff --git a/README.md b/README.md index 797f44ab..4d43a8cb 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # edhoc-rs +[![Build and test](https://github.com/openwsn-berkeley/edhoc-rs/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/openwsn-berkeley/edhoc-rs/actions/workflows/build-and-test.yml) + A microcontroller-optimized implementation of EDHOC in Rust (`no_std`). Supports: @@ -18,7 +20,9 @@ cargo build cargo test ``` -## Example +`edhoc_rs` can be compiled with different configurations depending on the enabled features. To learn what are the available features and how to select them for several configurations of build and test, check the [Github Actions file](./.github/workflows/rust.yml). + +## Example: EDHOC over CoAP on native host In one terminal, run an example CoAP server: ``` @@ -34,7 +38,7 @@ In the output you should find the EDHOC handshake messages and the derived OSCOR The source code for these examples is at `examples/coap/src/bin`. -## Example: flashing a device and selecting lib version / crypto backend +## Example: EDHOC on nRF52840 device with different crypto backends To build an example application that works on the [nrf52840dk](https://www.nordicsemi.com/Products/Development-hardware/nrf52840-dk), do as follows: @@ -42,10 +46,10 @@ To build an example application that works on the [nrf52840dk](https://www.nordi # head to the example `no_std` example cd ./examples/edhoc-rs-no_std -# build using the hacspec version of the lib, and software-based crypto -cargo build --target="thumbv7em-none-eabihf" --no-default-features --features="hacspec-psa, rtt" --release +# build using the psa crypto backend (software-based) +cargo build --target="thumbv7em-none-eabihf" --no-default-features --features="crypto-psa, rtt" --release -# build using the rust version of the lib, and hardware-accelerated crypto +# build using the cryptocell310 crypto backend (hardware-accelerated) cargo build --target="thumbv7em-none-eabihf" --no-default-features --features="crypto-cryptocell310, rtt" ``` @@ -53,15 +57,10 @@ To build **and** flash to the board, replace the word `build` with `embed` in th For example: `cargo embed --target="thumbv7em-none-eabihf" --no-default-features --features="cryptocell310, rtt"` -To see more examples on how to build it using different crypto backends and workspace features, check the [Github Actions file](./.github/workflows/rust.yml). - ## Directory structure This library is structured as a Workspace, a feature from Cargo which makes it easy to manage more than one package / application in the same repository. Here are its the main folders: - `lib`: The main library for the EDHOC implementation. - `examples`: Example applications that demonstrate how to use the EDHOC library. There are several subdirectories, each containing a different example application (e.g., coap, edhoc-rs-cc2538, edhoc-rs-no_std). -- `consts`: Defines constants used throughout the project. -- `crypto`: Implement wrappers from cryptographic operations that work in different targets (native, nrf52840 with and without hardware-accelerated crypto, etc.). -- `hacspec`: Leverages the Hacspec cryptographic specification language to implement the EDHOC protocol (the RFC stuff). - -To see how to select different features, check the [Github Actions file](./.github/workflows/rust.yml). +- `consts`: Defines constants and structs used throughout the project. +- `crypto`: Diferent cryptographic backends (e.g. psa, cryptocell310, hacspec).