openwsn-berkeley / lakers

EDHOC implemented in Rust, optimized for microcontrollers, with bindings for C and Python.
https://crates.io/crates/lakers
BSD 3-Clause "New" or "Revised" License
12 stars 10 forks source link

Ability to prepare and process more than one EAD field #177

Open geonnave opened 6 months ago

geonnave commented 6 months ago

Currently one either 0 or 1 EAD fields can be added to a message. This is not complete according to the EDHOC RFC, which specifies 0 or N EAD fields.

From the API perspective, here is one possible way to implement it (see this review comment):

let (state, msg1) = start.prepare_message1(x, g_x, c_i)
    .add_ead1(id, Some(bytes))?
    .add_ead1(more_id, None)?
    .finish(&mut crypto);