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
13 stars 10 forks source link

Error handling: Replace custom error enum with Rust's Result type #43

Closed malishav closed 1 year ago

malishav commented 1 year ago

The implementation currently defines a custom enum for error handling (see e.g. [1] and [2]). This issue aims at replacing the current error enum type with Rust's standard Result type [3]. For an example of how error handling should be done in the EDHOC protocol core, see hacspec v2 examples (e.g. [4]).

[1] https://github.com/openwsn-berkeley/edhoc-rs/blob/main/consts/src/lib.rs#L25 [2] https://github.com/openwsn-berkeley/edhoc-rs/blob/main/hacspec/src/lib.rs#L32 [3] https://doc.rust-lang.org/core/result/ [4] https://github.com/hacspec/hacspec-v2/blob/main/examples/aes128-gcm/src/aes128-gcm.rs#L8

malishav commented 1 year ago

Resolved with #48