Skip to content

Commit

Permalink
Update cbor-smol to v0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
robin-nitrokey committed Oct 22, 2024
1 parent a566b63 commit 721d1eb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
of being generic over the storage implementation.
- Add `nonce` argument to `wrap_key` and `unwrap_key` syscalls.
- Use nonce as IV for Aes256Cbc mechanism.
- Updated `cbor-smol` to 0.5.0.

### Fixed

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ sha2 = { version = "0.10", default-features = false }
# ours
cosey = "0.3"
delog = "0.1.0"
cbor-smol = "0.4"
cbor-smol = { version = "0.5", features = ["heapless-bytes-v0-3"] }
heapless-bytes = { version = "0.3.0" }
interchange = "0.3.0"
littlefs2 = "0.4.0"
Expand Down
10 changes: 9 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,17 @@ pub use error::Error;
pub use platform::Platform;
pub use service::Service;

pub use cbor_smol::{cbor_deserialize, cbor_serialize_bytes};
pub use cbor_smol::cbor_deserialize;
pub use heapless_bytes::Bytes;

pub fn cbor_serialize_bytes<T: serde::Serialize, const N: usize>(
object: &T,
) -> cbor_smol::Result<Bytes<N>> {
let mut data = Bytes::new();
cbor_smol::cbor_serialize_to(object, &mut data)?;
Ok(data)
}

pub(crate) use postcard::from_bytes as postcard_deserialize;

pub(crate) fn postcard_serialize_bytes<T: serde::Serialize, const N: usize>(
Expand Down

0 comments on commit 721d1eb

Please sign in to comment.