From 24b73c4293b01c0ee8bf53ca2ecad6231fd56872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9F=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2=20=5BArtyom=20Pavlov=5D?= Date: Fri, 17 Nov 2023 13:52:54 +0300 Subject: [PATCH] aead: enable `missing_debug_implementations` lint and add `Debug` impls --- aead/src/lib.rs | 8 +++++++- aead/src/stream.rs | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/aead/src/lib.rs b/aead/src/lib.rs index 62cf29dbb..0a6f2aff1 100644 --- a/aead/src/lib.rs +++ b/aead/src/lib.rs @@ -6,7 +6,12 @@ html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/8f1a9894/logo.svg" )] #![forbid(unsafe_code)] -#![warn(clippy::unwrap_used, missing_docs, rust_2018_idioms)] +#![warn( + clippy::unwrap_used, + missing_docs, + rust_2018_idioms, + missing_debug_implementations +)] #[cfg(feature = "alloc")] extern crate alloc; @@ -472,6 +477,7 @@ impl AeadMutInPlace for Alg { /// If you don't care about AAD, you can pass a `&[u8]` as the payload to /// `encrypt`/`decrypt` and it will automatically be coerced to this type. #[cfg(feature = "alloc")] +#[derive(Debug)] pub struct Payload<'msg, 'aad> { /// Message to be encrypted/decrypted pub msg: &'msg [u8], diff --git a/aead/src/stream.rs b/aead/src/stream.rs index 13aa593ef..cbed91a6f 100644 --- a/aead/src/stream.rs +++ b/aead/src/stream.rs @@ -199,6 +199,7 @@ macro_rules! impl_stream_object { #[doc = "[Online Authenticated-Encryption and its Nonce-Reuse Misuse-Resistance][1]."] #[doc = ""] #[doc = "[1]: https://eprint.iacr.org/2015/189.pdf"] + #[derive(Debug)] pub struct $name where A: AeadInPlace, @@ -361,6 +362,7 @@ impl_stream_object!( /// the last 5-bytes of the AEAD nonce. /// /// [1]: https://eprint.iacr.org/2015/189.pdf +#[derive(Debug)] pub struct StreamBE32 where A: AeadInPlace, @@ -450,6 +452,7 @@ where /// when interpreted as a 32-bit integer. /// /// The 31-bit + 1-bit value is stored as the last 4 bytes of the AEAD nonce. +#[derive(Debug)] pub struct StreamLE31 where A: AeadInPlace,