1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// SPDX-FileCopyrightText: Copyright © 2026 ReallyMe LLC. All rights reserved
//
// SPDX-License-Identifier: Apache-2.0
//! Deterministic DAG-CBOR codec for authoritative, cryptographically
//! signed data.
//!
//! The decoder is strict by construction: it rejects non-canonical
//! integers, indefinite-length items, floats, tags, out-of-order map keys,
//! and trailing bytes, so a given value has exactly one accepted encoding.
//! Decoding untrusted input is bounded in both memory and stack depth —
//! container length prefixes are checked against the remaining input
//! before any allocation, and nesting is capped at
//! [`MAX_NESTING_DEPTH`] — so neither a crafted length nor pathological
//! nesting can drive an out-of-memory or stack-overflow abort.
/// Maximum array/map nesting depth accepted by [`decode_dag_cbor`].
///
/// Authoritative documents in this system are shallow; this bound is far
/// above any legitimate structure while still stopping a hostile input
/// from recursing the decoder into a stack overflow.
pub const MAX_NESTING_DEPTH: usize = 128;
pub use ;
pub use decode_dag_cbor;
pub use encode_dag_cbor;
pub use CborError;
pub use CborValue;