diff --git a/Cargo.lock b/Cargo.lock index 78920f2c..243da467 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -161,7 +161,7 @@ name = "ecdsa" version = "0.13.1" dependencies = [ "der 0.5.1", - "elliptic-curve 0.11.2", + "elliptic-curve 0.11.3", "hex-literal", "rfc6979", "sha2", @@ -221,9 +221,9 @@ dependencies = [ [[package]] name = "elliptic-curve" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "befe3b23562c66e85abf1bcc872d4d59ac058fcd1db38afb16620cd45bbc65e4" +checksum = "4c4c31bb557a73d165c838b614521f888112f9d4fcff7421d35646376dd17caf" dependencies = [ "crypto-bigint 0.3.2", "der 0.5.1", diff --git a/ecdsa/src/lib.rs b/ecdsa/src/lib.rs index 830331db..a5b5af68 100644 --- a/ecdsa/src/lib.rs +++ b/ecdsa/src/lib.rs @@ -1,5 +1,13 @@ #![doc = include_str!("../README.md")] +//! ## `serde` support +//! +//! When the `serde` feature of this crate is enabled, `Serialize` and +//! `Deserialize` impls are provided for the [`Signature`] and [`VerifyingKey`] +//! types. +//! +//! Please see type-specific documentation for more information. +//! //! ## Interop //! //! Any crates which provide an implementation of ECDSA for a particular @@ -114,6 +122,15 @@ pub type SignatureBytes = GenericArray>; /// /// ASN.1 DER-encoded signatures also supported via the /// [`Signature::from_der`] and [`Signature::to_der`] methods. +/// +/// # `serde` support +/// +/// When the `serde` feature of this crate is enabled, it provides support for +/// serializing and deserializing ECDSA signatures using the `Serialize` and +/// `Deserialize` traits. +/// +/// The serialization uses a 64-byte fixed encoding when used with binary +/// formats, and a hexadecimal encoding when used with text formats. #[derive(Clone, Eq, PartialEq)] pub struct Signature where diff --git a/ecdsa/src/verify.rs b/ecdsa/src/verify.rs index 9ef931a4..fd05b9ef 100644 --- a/ecdsa/src/verify.rs +++ b/ecdsa/src/verify.rs @@ -30,6 +30,15 @@ use elliptic_curve::serde::{de, ser, Deserialize, Serialize}; /// /// Requires an [`elliptic_curve::ProjectiveArithmetic`] impl on the curve, and a /// [`VerifyPrimitive`] impl on its associated `AffinePoint` type. +/// +/// # `serde` support +/// +/// When the `serde` feature of this crate is enabled, it provides support for +/// serializing and deserializing ECDSA signatures using the `Serialize` and +/// `Deserialize` traits. +/// +/// The serialization leverages the encoding used by the [`PublicKey`] type, +/// which is a binary-oriented ASN.1 DER encoding. #[cfg_attr(docsrs, doc(cfg(feature = "verify")))] #[derive(Clone, Debug)] pub struct VerifyingKey