4 releases

Uses new Rust 2021

new 0.2.0-pre.2 Nov 25, 2021
0.2.0-pre.1 Nov 22, 2021
0.1.2 Jul 7, 2021
0.1.1 Jun 29, 2021
0.1.0 Jun 11, 2021

#493 in Procedural macros

Download history 10/week @ 2021-08-09 10/week @ 2021-08-16 6/week @ 2021-08-23 72/week @ 2021-09-06 237/week @ 2021-09-13 163/week @ 2021-09-20 197/week @ 2021-09-27 1010/week @ 2021-10-04 407/week @ 2021-10-11 473/week @ 2021-10-18 636/week @ 2021-10-25 367/week @ 2021-11-01 1179/week @ 2021-11-08 1197/week @ 2021-11-15 1369/week @ 2021-11-22

2,244 downloads per month
Used in 6 crates (via tls_codec)

Apache-2.0 OR MIT

18KB
408 lines

RustCrypto: TLS Codec

MIT licensed Project Chat Rust Version

crates.io docs.rs
tls_codec Docs
tls_codec_derive Docs

This crate implements the TLS codec as defined in RFC 8446 as well as some extensions required by MLS.

With the derive feature TlsSerialize and TlsDeserialize can be derived.

The crate also provides the following data structures that implement TLS serialization/deserialization

  • u8, u16, u32, u64
  • TlsVecU8, TlsVecU16, TlsVecU32
  • SecretTlsVecU8, SecretTlsVecU16, SecretTlsVecU32 The same as the TlsVec* versions but it implements zeroize, requiring the elements to implement zeroize as well.
  • TlsSliceU8, TlsSliceU16, TlsSliceU32 are lightweight wrapper for slices that allow to serialize them without having to create a TlsVec*.
  • TlsByteSliceU8, TlsByteSliceU16, TlsByteSliceU32, and TlsByteVecU8, TlsByteVecU16, TlsByteVecU32 are provided with optimized implementations for byte vectors.
  • [u8; l], for l ∈ [1..128]
  • Serialize for Option<T> where T: Serialize
  • Deserialize for Option<T> where T: Deserialize
  • Serialize for (T, U) and (T, U, V) where T, U, V implement Serialize`
  • Deserialize for (T, U) and (T, U, V) where T, U, V implement Deserialize`

Minimum Supported Rust Version

This crate requires Rust 1.56 at a minimum.

We may change the MSRV in the future, but 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

~295–710KB
~18K SLoC