Code Monkey home page Code Monkey logo

edhoc-rs's Introduction

edhoc-rs

Build and test

A microcontroller-optimized implementation of EDHOC in Rust (no_std).

Supports:

  • Roles: Initiator, Responder (hacspec only)
  • Authentication mode: STAT-STAT
  • Cipher suite: 2 (AES-CCM-16-64-128, SHA-256, 8, P-256, ES256, AES-CCM-16-64-128, SHA-256)

Installation

  1. Make sure you have Rust installed (see instructions in the website).

  2. Download, compile, and run the tests:

git clone [email protected]:openwsn-berkeley/edhoc-rs.git && cd edhoc-rs
cargo build
cargo test

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.

Example: EDHOC over CoAP on native host

In one terminal, run an example CoAP server:

cargo run --bin coapserver

In another one, run the client:

cargo run --bin coapclient

In the output you should find the EDHOC handshake messages and the derived OSCORE secret/salt.

The source code for these examples is at examples/coap/src/bin.

Example: EDHOC on nRF52840 device with different crypto backends

To build an example application that works on the nrf52840dk, do as follows:

# head to the example `no_std` example
cd ./examples/edhoc-rs-no_std

# build using the cryptocell310 crypto backend (hardware-accelerated)
cargo build --target="thumbv7em-none-eabihf" --release

# build using the psa crypto backend (software-based)
cargo build --target="thumbv7em-none-eabihf" --no-default-features --features="crypto-psa, ead-none, rtt" --release

To build and flash to the board, replace the word build with embed in the commands above (you may need to cargo install cargo-embed).

For example: cargo embed --target="thumbv7em-none-eabihf" --no-default-features --features="crypto-psa, ead-none, rtt"

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 and structs used throughout the project.
  • crypto: Diferent cryptographic backends (e.g. psa, cryptocell310, hacspec).

edhoc-rs's People

Contributors

chrysn avatar geonnave avatar kaspar030 avatar malishav avatar thvdveld avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.