Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cbor-smol to v0.5.0 #175

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading