From 6d83f86ddd765bc303a4be9464c8abfef9759f0d Mon Sep 17 00:00:00 2001 From: Jonathan Woollett-Light Date: Fri, 26 May 2023 16:23:04 +0100 Subject: [PATCH] fix: `missing_debug_implementations` Signed-off-by: Jonathan Woollett-Light --- aes-gcm-siv/src/lib.rs | 4 ++-- aes-gcm/src/lib.rs | 4 ++-- aes-siv/src/lib.rs | 8 +++++++- aes-siv/src/siv.rs | 1 + ascon-aead/src/asconcore.rs | 7 +++++-- ascon-aead/src/lib.rs | 7 +++++-- ccm/src/lib.rs | 4 ++-- chacha20poly1305/src/lib.rs | 3 ++- deoxys/src/deoxys_bc.rs | 2 ++ deoxys/src/lib.rs | 3 ++- deoxys/src/modes.rs | 2 ++ eax/src/lib.rs | 4 ++-- eax/src/online.rs | 4 ++++ 13 files changed, 38 insertions(+), 15 deletions(-) diff --git a/aes-gcm-siv/src/lib.rs b/aes-gcm-siv/src/lib.rs index f04c5848..70b40a61 100644 --- a/aes-gcm-siv/src/lib.rs +++ b/aes-gcm-siv/src/lib.rs @@ -5,7 +5,7 @@ html_logo_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg", html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg" )] -#![warn(missing_docs, rust_2018_idioms)] +#![warn(missing_debug_implementations, missing_docs, rust_2018_idioms)] //! # Usage //! @@ -123,7 +123,7 @@ pub type Aes256GcmSiv = AesGcmSiv; type Ctr32LE = ctr::CtrCore; /// AES-GCM-SIV: Misuse-Resistant Authenticated Encryption Cipher (RFC 8452). -#[derive(Clone)] +#[derive(Debug, Clone)] pub struct AesGcmSiv { /// Key generating key used to derive AES-GCM-SIV subkeys. key_generating_key: Aes, diff --git a/aes-gcm/src/lib.rs b/aes-gcm/src/lib.rs index c6a67e5e..e8d0d49f 100644 --- a/aes-gcm/src/lib.rs +++ b/aes-gcm/src/lib.rs @@ -6,7 +6,7 @@ html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg" )] #![deny(unsafe_code)] -#![warn(missing_docs, rust_2018_idioms)] +#![warn(missing_debug_implementations, missing_docs, rust_2018_idioms)] //! # Usage //! @@ -189,7 +189,7 @@ type Ctr32BE = ctr::CtrCore; /// the default of 128-bits. /// /// If in doubt, use the built-in [`Aes128Gcm`] and [`Aes256Gcm`] type aliases. -#[derive(Clone)] +#[derive(Debug, Clone)] pub struct AesGcm where TagSize: self::TagSize, diff --git a/aes-siv/src/lib.rs b/aes-siv/src/lib.rs index 8e8e6677..29b3f520 100644 --- a/aes-siv/src/lib.rs +++ b/aes-siv/src/lib.rs @@ -5,7 +5,12 @@ html_logo_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg", html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg" )] -#![warn(missing_docs, rust_2018_idioms, unused_qualifications)] +#![warn( + missing_debug_implementations, + missing_docs, + rust_2018_idioms, + unused_qualifications +)] //! # Usage //! @@ -113,6 +118,7 @@ pub type Tag = GenericArray; /// The `SivAead` type wraps the more powerful `Siv` interface in a more /// commonly used Authenticated Encryption with Associated Data (AEAD) API, /// which accepts a key, nonce, and associated data when encrypting/decrypting. +#[derive(Debug)] pub struct SivAead where Self: KeySizeUser, diff --git a/aes-siv/src/siv.rs b/aes-siv/src/siv.rs index 4c61f8b7..6b23e97d 100644 --- a/aes-siv/src/siv.rs +++ b/aes-siv/src/siv.rs @@ -38,6 +38,7 @@ pub type KeySize = <::KeySize as Add>::Output; /// Synthetic Initialization Vector (SIV) mode, providing misuse-resistant /// authenticated encryption (MRAE). +#[derive(Debug)] pub struct Siv where C: BlockCipher + BlockEncryptMut + KeyInit + KeySizeUser, diff --git a/ascon-aead/src/asconcore.rs b/ascon-aead/src/asconcore.rs index 1e37e256..65b27050 100644 --- a/ascon-aead/src/asconcore.rs +++ b/ascon-aead/src/asconcore.rs @@ -56,7 +56,7 @@ pub(crate) trait InternalKey>: fn get_k2(&self) -> u64; } -#[derive(Clone)] +#[derive(Debug, Clone)] #[cfg_attr(feature = "zeroize", derive(zeroize::Zeroize, zeroize::ZeroizeOnDrop))] pub(crate) struct InternalKey16(u64, u64); @@ -83,7 +83,7 @@ impl From<&GenericArray> for InternalKey16 { } } -#[derive(Clone)] +#[derive(Debug, Clone)] #[cfg_attr(feature = "zeroize", derive(zeroize::Zeroize, zeroize::ZeroizeOnDrop))] pub(crate) struct InternalKey20(u64, u64, u32); @@ -134,6 +134,7 @@ pub(crate) trait Parameters { } /// Parameters for Ascon-128 +#[derive(Debug)] pub(crate) struct Parameters128; impl Parameters for Parameters128 { @@ -145,6 +146,7 @@ impl Parameters for Parameters128 { } /// Parameters for Ascon-128a +#[derive(Debug)] pub(crate) struct Parameters128a; impl Parameters for Parameters128a { @@ -156,6 +158,7 @@ impl Parameters for Parameters128a { } /// Parameters for Ascon-80pq +#[derive(Debug)] pub(crate) struct Parameters80pq; impl Parameters for Parameters80pq { diff --git a/ascon-aead/src/lib.rs b/ascon-aead/src/lib.rs index 43993411..9e33ccbc 100644 --- a/ascon-aead/src/lib.rs +++ b/ascon-aead/src/lib.rs @@ -8,7 +8,7 @@ html_logo_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg", html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg" )] -#![warn(missing_docs)] +#![warn(missing_debug_implementations, missing_docs)] //! ## Usage //! @@ -112,7 +112,7 @@ use asconcore::{AsconCore, Parameters, Parameters128, Parameters128a, Parameters /// /// This type is generic to support substituting various Ascon parameter sets. It is not intended to /// be uses directly. Use the [`Ascon128`], [`Ascon128a`], [`Ascon80pq`] type aliases instead. -#[derive(Clone)] +#[derive(Debug, Clone)] struct Ascon { key: P::InternalKey, } @@ -173,6 +173,7 @@ impl AeadInPlace for Ascon

{ } /// Ascon-128 +#[derive(Debug)] pub struct Ascon128(Ascon); /// Key for Ascon-128 pub type Ascon128Key = Key; @@ -223,6 +224,7 @@ impl AeadInPlace for Ascon128 { } /// Ascon-128a +#[derive(Debug)] pub struct Ascon128a(Ascon); /// Key for Ascon-128a @@ -274,6 +276,7 @@ impl AeadInPlace for Ascon128a { } /// Ascon-80pq +#[derive(Debug)] pub struct Ascon80pq(Ascon); /// Key for Ascon-80pq pub type Ascon80pqKey = Key; diff --git a/ccm/src/lib.rs b/ccm/src/lib.rs index b6e75d74..5b76fe04 100644 --- a/ccm/src/lib.rs +++ b/ccm/src/lib.rs @@ -5,7 +5,7 @@ html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg" )] #![deny(unsafe_code)] -#![warn(missing_docs, rust_2018_idioms)] +#![warn(missing_debug_implementations, missing_docs, rust_2018_idioms)] //! # Usage //! @@ -91,7 +91,7 @@ impl NonceSize for T {} /// [`U7`][consts::U7], [`U8`][consts::U8], [`U9`][consts::U9], /// [`U10`][consts::U10], [`U11`][consts::U11], [`U12`][consts::U12], /// [`U13`][consts::U13]. -#[derive(Clone)] +#[derive(Debug, Clone)] pub struct Ccm where C: BlockCipher + BlockSizeUser + BlockEncrypt, diff --git a/chacha20poly1305/src/lib.rs b/chacha20poly1305/src/lib.rs index a1a43745..1902d2e2 100644 --- a/chacha20poly1305/src/lib.rs +++ b/chacha20poly1305/src/lib.rs @@ -5,7 +5,7 @@ html_logo_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg", html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg" )] -#![warn(missing_docs, rust_2018_idioms)] +#![warn(missing_debug_implementations, missing_docs, rust_2018_idioms)] //! ## Supported Algorithms //! @@ -211,6 +211,7 @@ pub type XChaCha12Poly1305 = ChaChaPoly1305; /// Generic ChaCha+Poly1305 Authenticated Encryption with Additional Data (AEAD) construction. /// /// See the [toplevel documentation](index.html) for a usage example. +#[derive(Debug)] pub struct ChaChaPoly1305 = U12> { /// Secret key. key: Key, diff --git a/deoxys/src/deoxys_bc.rs b/deoxys/src/deoxys_bc.rs index ff974edf..e7ba1622 100644 --- a/deoxys/src/deoxys_bc.rs +++ b/deoxys/src/deoxys_bc.rs @@ -36,9 +36,11 @@ const RCON: [[u8; 16]; 17] = [ ]; /// Implementation of the Deoxys-BC256 block cipher +#[derive(Debug)] pub struct DeoxysBc256; /// Implementation of the Deoxys-BC384 block cipher +#[derive(Debug)] pub struct DeoxysBc384; pub trait DeoxysBcInternal { diff --git a/deoxys/src/lib.rs b/deoxys/src/lib.rs index 7d44b2e1..a8323d62 100644 --- a/deoxys/src/lib.rs +++ b/deoxys/src/lib.rs @@ -4,7 +4,7 @@ html_logo_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg", html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg" )] -#![warn(missing_docs, rust_2018_idioms)] +#![warn(missing_debug_implementations, missing_docs, rust_2018_idioms)] //! # Usage //! @@ -223,6 +223,7 @@ pub trait DeoxysBcType: deoxys_bc::DeoxysBcInternal { /// Generic Deoxys implementation. /// /// This type is generic to support multiple Deoxys modes(namely Deoxys-I and Deoxys-II) and key size. +#[derive(Debug)] pub struct Deoxys where M: DeoxysMode, diff --git a/deoxys/src/modes.rs b/deoxys/src/modes.rs index 7bcb6362..b1742223 100644 --- a/deoxys/src/modes.rs +++ b/deoxys/src/modes.rs @@ -14,12 +14,14 @@ const TWEAK_M_LAST: u8 = 0x40; const TWEAK_CHKSUM: u8 = 0x50; /// Implementation of the Deoxys-I mode of operation. +#[derive(Debug)] pub struct DeoxysI { _ptr: PhantomData, } /// Implementation of the Deoxys-II mode of operation. #[allow(clippy::upper_case_acronyms)] +#[derive(Debug)] pub struct DeoxysII { _ptr: PhantomData, } diff --git a/eax/src/lib.rs b/eax/src/lib.rs index e8323d74..8f02375e 100644 --- a/eax/src/lib.rs +++ b/eax/src/lib.rs @@ -6,7 +6,7 @@ html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg" )] #![deny(unsafe_code)] -#![warn(missing_docs, rust_2018_idioms)] +#![warn(missing_debug_implementations, missing_docs, rust_2018_idioms)] //! # Usage //! @@ -166,7 +166,7 @@ type Ctr128BE = ctr::CtrCore; /// ## Type parameters /// - `Cipher`: block cipher. /// - `M`: size of MAC tag, valid values: up to `U16`. -#[derive(Clone)] +#[derive(Debug, Clone)] pub struct Eax where Cipher: BlockCipher + BlockEncrypt + Clone + KeyInit, diff --git a/eax/src/online.rs b/eax/src/online.rs index 12ab75a0..9ee30061 100644 --- a/eax/src/online.rs +++ b/eax/src/online.rs @@ -72,10 +72,12 @@ pub use Eax as EaxOnline; pub trait CipherOp {} /// Marker struct for EAX stream used in encryption mode. +#[derive(Debug)] pub struct Encrypt; impl CipherOp for Encrypt {} /// Marker struct for EAX stream used in decryption mode. +#[derive(Debug)] pub struct Decrypt; impl CipherOp for Decrypt {} @@ -148,6 +150,7 @@ impl CipherOp for Decrypt {} /// [`Eax`]: ../struct.Eax.html /// [`Decrypt`]: struct.Decrypt.html /// [`finish`]: #method.finish +#[derive(Debug)] pub struct Eax where Cipher: BlockCipher + BlockEncrypt + Clone + KeyInit, @@ -263,6 +266,7 @@ where /// Main reason behind extracting the logic to a single, separate type is to /// facilitate testing of the internal logic. #[doc(hidden)] +#[derive(Debug)] struct EaxImpl where Cipher: BlockCipher + BlockEncrypt + Clone + KeyInit,