41 Commits
Author SHA1 Message Date
Sosthène GuédonandSosthène Guédon 72242c972f Prepare release 0.5.1 v0.5.1 2025-10-01 11:38:23 +02:00
Sosthène GuédonandSosthène Guédon 32b8ba7bf0 Fix clippy warnings 2025-10-01 11:38:23 +02:00
Sosthène GuédonandSosthène Guédon 66d760c231 Migrate to serde-core
This should make compilation faster for downstream
2025-10-01 11:38:23 +02:00
Sosthène GuédonandSosthène Guédon 0b146b79e4 Add support for heapless 0.9 and heapless-bytes 0.5 2025-10-01 11:38:23 +02:00
Robin Krahl bd92517cec Remove usize value from Error::SerializeBufferFull
The value is not used (and actually does not provide much insight) but
bloats the error enum – just removing it yields a ~ 5k binary size
increase on nitrokey-3-firmware.
2024-10-21 23:00:28 +02:00
Robin Krahl ad9c4c8445 Bump version in Cargo.toml
I forgot to update Cargo.toml in https://github.com/trussed-dev/cbor-smol/pull/20.
0.5.0
2024-10-21 15:47:26 +02:00
Robin Krahl 6ef370611e Release v0.5.0 2024-10-21 10:08:13 +02:00
Robin Krahl d499e527f1 Mark Error as non-exhaustive
Adding a new error variant should not be a breaking change.

Fixes: https://github.com/trussed-dev/cbor-smol/issues/11
2024-10-18 12:15:35 +02:00
Sosthène Guédonandsosthene-nitrokey 4a368461e0 Fix clippy warnings 2024-10-09 16:06:10 +02:00
Sosthène Guédonandsosthene-nitrokey 0de6901702 Remove dead code 2024-10-09 16:06:10 +02:00
Sosthène Guédonandsosthene-nitrokey 40222481f9 Improve backwards compatibility 2024-10-09 16:06:10 +02:00
Sosthène Guédonandsosthene-nitrokey b82cfce308 Attempt to improve size 2024-10-09 16:06:10 +02:00
Sosthène Guédonandsosthene-nitrokey 40708abdc5 Support multiple versions of heapless and heapless bytes
This allows better backwards compatibility and serializing to heapless directly.

Given https://github.com/trussed-dev/cbor-smol/issues/11 I went with a breaking change update
(the `Serializer` field was public and existing implementations are put behind a breaking change)
2024-10-09 16:06:10 +02:00
Robin Krahl 3e9e218f55 Release v0.4.1
This patch also removes the bytes-from-array feature:  We originally
added it to the fork so that a wrong patched version would cause a
compiler error.  Now we can just bump the required minimum version
instead.
0.4.1
2024-10-08 15:48:14 +02:00
Robin Krahl 797f45de03 Revert "Never inline map value deserialization"
This reverts commit 6b3ce6928e.

The change has been superseded by
https://github.com/Nitrokey/cbor-smol/pull/4 =
https://github.com/trussed-dev/cbor-smol/pull/15 so it was unnecessary
to port it to upstream in
https://github.com/trussed-dev/cbor-smol/pull/16.
2024-10-07 19:45:38 +02:00
Robin Krahlandsosthene-nitrokey 2ba6ee356e Handle bytes identifier as UTF-8 strings
Previously, we visited either strings or bytes so that the visitor had
to handle both cases.  With this change, we always visit strings so that
the bytes visitor function can be optimized out. This significantly
reduces binary size.
2024-10-07 13:48:37 +02:00
Sosthène Guédonandsosthene-nitrokey c48b2b29df deserialize_identifier: add support for all types expected by serde
The default serde deserialize derive accepts 3 types for identifiers:

- The name of the field as `str`
- The name of the field as ascii bytes
- The index of the field as u64

This PR changes deserialize_identifier to have compatibility with all of these
This is necessary for https://github.com/Nitrokey/fido-authenticator/issues/57,
which needs compatibility with both the str variant and the index variant
2024-10-07 13:48:37 +02:00
Robin Krahl 6b3ce6928e Never inline map value deserialization
Inlining it means that the deserialization of basic datatypes is inlined
into all deserialization functions, leading to a significant overhead.
2024-10-07 13:20:53 +02:00
Robin Krahlandsosthene-nitrokey 6e243dd703 Never inline map and tuple deserialization 2024-10-07 10:24:44 +02:00
Sosthène Guédonandsosthene-nitrokey da58de381d Add feature for deserializing bytes from an array 2024-10-02 12:04:54 +02:00
Sosthène Guédonandsosthene-nitrokey cbd34a5616 deserialize_bytes: accept arrays 2024-10-02 12:04:54 +02:00
Sosthène Guédonandsosthene-nitrokey 336941c342 Use constants in match statement 2024-10-02 12:04:03 +02:00
Sosthène Guédonandsosthene-nitrokey 620f8c0c61 Fuzz added support for i64 and fix crash in fuzzing 2024-10-02 12:04:03 +02:00
Sosthène Guédonandsosthene-nitrokey 0326d75fee Implement deserializing ignored_any 2024-10-02 12:04:03 +02:00
Sosthène Guédonandsosthene-nitrokey 5d9247c34b Add ?Sized trait bound
Fix #9
2024-10-02 10:34:17 +02:00