#crypto #constant-time #serde

no-std serdect

Constant-time serde serializer/deserializer helpers for data that potentially contains secrets (e.g. cryptographic keys)

1 unstable release

Uses new Rust 2021

0.1.0 Mar 29, 2022

#18 in #constant-time

Download history 1025/week @ 2022-08-13 763/week @ 2022-08-20 979/week @ 2022-08-27 1642/week @ 2022-09-03 2403/week @ 2022-09-10 735/week @ 2022-09-17 1906/week @ 2022-09-24 702/week @ 2022-10-01 677/week @ 2022-10-08 797/week @ 2022-10-15 473/week @ 2022-10-22 1178/week @ 2022-10-29 2488/week @ 2022-11-05 849/week @ 2022-11-12 1196/week @ 2022-11-19 674/week @ 2022-11-26

5,339 downloads per month
Used in 14 crates (11 directly)

Apache-2.0 OR MIT

39KB
591 lines

RustCrypto: Constant-Time Serde Helpers

Crate Docs Build Status Apache 2.0/MIT Licensed MSRV

Constant-time serde serializer/deserializer helpers for data that potentially contains secrets (e.g. cryptographic keys)

Documentation

About

Serialization is a potential sidechannel for leaking sensitive secrets such as cryptographic keys.

This crate provides "best effort" constant-time helper methods for reducing the amount of timing variability involved in serializing/deserializing data when using serde, Rust's standard serialization framework.

These helper methods conditionally serialize data as hexadecimal using the constant-time base16ct crate when using human-readable formats such as JSON or TOML. When using a binary format, the data is serialized as-is into binary.

While this crate can't ensure that format implementations don't perform other kinds of data-dependent branching on the contents of the serialized data, using a constant-time hex serialization with human-readable formats should help reduce the overall timing variability.

Minimum Supported Rust Version

Rust 1.56 or newer.

In the future, we reserve the right to change MSRV (i.e. MSRV is out-of-scope for this crate's SemVer guarantees), however when we do it will be accompanied by a minor version bump.

License

Licensed under either of:

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~130–260KB