diff --git a/README.md b/README.md index c692ae5..f07dfdf 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Embedded-TLS is a Rust-native TLS 1.3 implementation that works in a no-std environment. The Rust crate was formerly known as `drogue-tls`. The implementation is work in progress, but the [example clients](https://github.com/drogue-iot/embedded-tls/tree/main/examples) should work against the [rustls](https://github.com/ctz/rustls) echo server. -The client supports both async and blocking modes. By default, the `async` and `std` features are enabled. The `async` feature requires Rust nightly, while the blocking feature works on Rust stable. +The client supports both async and blocking modes. By default, the `std` feature is enabled, but can be disabled for bare metal usage. To use the async mode, import `embedded_tls::*`. To use the blocking mode, import `embedded_tls::blocking::*`. diff --git a/src/lib.rs b/src/lib.rs index 0e9ea52..c4eb405 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,26 +1,6 @@ #![cfg_attr(not(any(test, feature = "std")), no_std)] +#![doc = include_str!("../README.md")] #![allow(dead_code)] -//! Embedded-TLS is a Rust-native TLS 1.3 implementation that works in a no-std environment. The -//! implementation is work in progress, but the [example clients](https://github.com/drogue-iot/embedded-tls/tree/main/examples) should work against the [rustls](https://github.com/ctz/rustls) echo server. -//! -//! The client supports both async and blocking modes. By default, the `std` feature is enabled, but can be disabled for bare metal usage. -//! -//! To use the async mode, import `embedded_tls::*`. To use the blocking mode, import `embedded_tls::blocking::*`. -//! -//! Some features like certificate validation are still not implemented, have a look at [open issues](https://github.com/drogue-iot/embedded-tls/issues). -//! Only supports writing/receiving one frame at a time, hence using a frame buffer larger than 16k is not currently needed. You may use a lower frame buffer size, but there is no guarantee that it will be able to parse any TLS 1.3 frame. -//! -//! Usage of this crate should fit in 20 kB of RAM assuming a frame buffer of 16 kB (max TLS record size). This is not including the space used to hold the CA and any client certificates. -//! -//! Some memory usage statistics for async operation: -//! -//! * TlsConnection: frame_buffer size + 2kB for the rest. This can probably be reduced with some additional tuning. -//! * Handshake stack usage: currently at 2 kB -//! * Write stack usage: currently at 560 B -//! * Read stack usage: currently at 232 B -//! -//! -//! NOTE: This is very fresh and is probably not meeting all parts of the TLS 1.3 spec. If you find anything you'd like to get implemented, feel free to raise an issue. /*! # Example