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

python: Don't return Vec<u8> #257

Closed chrysn closed 5 months ago

chrysn commented 5 months ago

The ID_CRED_x returned in the initiator and responder APIs are unintuitive for Python users when arrays (esp. if they see examples where it's a [10] style single value -- to a Python user that looks more like a parsed CBOR, more so if that is actually what parsing a CBOR sequence would give). Returning it as Python bytes makes it easier to understand that this is the opaque data indicating either an identifier or a credential by value.

Closes: https://github.com/openwsn-berkeley/lakers/issues/256

geonnave commented 5 months ago

Looks good, thank you. (this was an overlook on my side, initially did all with Vec but then realized bytes was better, and obviously forgot to update some functions 🙃)