#coap #oscore #liboscore #no-alloc

sys no-std liboscore

Rust wrapper around the libOSCORE implementation of OSCORE (RFC8613), a security layer for CoAP

7 releases

0.2.4 Feb 14, 2025
0.2.3 Feb 14, 2025
0.2.2 Dec 6, 2024
0.2.1 Nov 25, 2024
0.1.0 Apr 17, 2024

#2195 in Embedded development

Download history 287/week @ 2025-01-16 256/week @ 2025-01-23 111/week @ 2025-01-30 1008/week @ 2025-02-06 1266/week @ 2025-02-13 494/week @ 2025-02-20 313/week @ 2025-02-27 501/week @ 2025-03-06 543/week @ 2025-03-13 223/week @ 2025-03-20 530/week @ 2025-03-27 108/week @ 2025-04-03 172/week @ 2025-04-10 183/week @ 2025-04-17 167/week @ 2025-04-24 792/week @ 2025-05-01

1,327 downloads per month
Used in coapcore

BSD-3-Clause

165KB
3K SLoC

Rust 1.5K SLoC // 0.1% comments C 1.5K SLoC // 0.2% comments

This is the main crate of libOSCORE when accessing libOSCORE through Rust.

It performs different tasks that are relatively tightly coupled:

  • It builds the C header files for the Rust backend implementations using cbindgen.
  • It configures and builds Rust "header" files from the C header files (excluding types that are already native Rust types), as a -sys crate would do.
  • It compiles the C files of liboscore directly for static linking.
  • It implements coap-message on top of OSCORE protected messages.

At present, it pulls in both the cryptography and the message backends written in Rust (liboscore-cryptobackend and liboscore-msgbackend). Making the cryptography backend optional would be simple and straightforward (and is just waiting for an application to need it). Using an non-Rust message backend would be possible in theory, but the author fails to imagine when that would be useful. Some extra constructors for protected messages might be needed.

Dependencies

~3–7MB
~122K SLoC