Skip to content

Commit

Permalink
fix: missing_debug_implementations
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Woollett-Light <[email protected]>
  • Loading branch information
Jonathan Woollett-Light committed May 26, 2023
1 parent 3ce3f1f commit 567072f
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 15 deletions.
4 changes: 2 additions & 2 deletions aes-gcm-siv/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
//!
Expand Down Expand Up @@ -123,7 +123,7 @@ pub type Aes256GcmSiv = AesGcmSiv<Aes256>;
type Ctr32LE<Aes> = ctr::CtrCore<Aes, ctr::flavors::Ctr32LE>;

/// AES-GCM-SIV: Misuse-Resistant Authenticated Encryption Cipher (RFC 8452).
#[derive(Clone)]
#[derive(Debug, Clone)]
pub struct AesGcmSiv<Aes> {
/// Key generating key used to derive AES-GCM-SIV subkeys.
key_generating_key: Aes,
Expand Down
4 changes: 2 additions & 2 deletions aes-gcm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
//!
Expand Down Expand Up @@ -189,7 +189,7 @@ type Ctr32BE<Aes> = ctr::CtrCore<Aes, ctr::flavors::Ctr32BE>;
/// 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<Aes, NonceSize, TagSize = U16>
where
TagSize: self::TagSize,
Expand Down
3 changes: 2 additions & 1 deletion aes-siv/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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, unused_qualifications)]
#![warn(missing_debug_implementations, missing_docs, rust_2018_idioms, unused_qualifications)]

//! # Usage
//!
Expand Down Expand Up @@ -113,6 +113,7 @@ pub type Tag = GenericArray<u8, U16>;
/// 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<C, M>
where
Self: KeySizeUser,
Expand Down
1 change: 1 addition & 0 deletions aes-siv/src/siv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ pub type KeySize<C> = <<C as KeySizeUser>::KeySize as Add>::Output;

/// Synthetic Initialization Vector (SIV) mode, providing misuse-resistant
/// authenticated encryption (MRAE).
#[derive(Debug)]
pub struct Siv<C, M>
where
C: BlockCipher<BlockSize = U16> + BlockEncryptMut + KeyInit + KeySizeUser,
Expand Down
7 changes: 5 additions & 2 deletions ascon-aead/src/asconcore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pub(crate) trait InternalKey<KS: ArrayLength<u8>>:
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);

Expand All @@ -83,7 +83,7 @@ impl From<&GenericArray<u8, U16>> for InternalKey16 {
}
}

#[derive(Clone)]
#[derive(Debug, Clone)]
#[cfg_attr(feature = "zeroize", derive(zeroize::Zeroize, zeroize::ZeroizeOnDrop))]
pub(crate) struct InternalKey20(u64, u64, u32);

Expand Down Expand Up @@ -134,6 +134,7 @@ pub(crate) trait Parameters {
}

/// Parameters for Ascon-128
#[derive(Debug)]
pub(crate) struct Parameters128;

impl Parameters for Parameters128 {
Expand All @@ -145,6 +146,7 @@ impl Parameters for Parameters128 {
}

/// Parameters for Ascon-128a
#[derive(Debug)]
pub(crate) struct Parameters128a;

impl Parameters for Parameters128a {
Expand All @@ -156,6 +158,7 @@ impl Parameters for Parameters128a {
}

/// Parameters for Ascon-80pq
#[derive(Debug)]
pub(crate) struct Parameters80pq;

impl Parameters for Parameters80pq {
Expand Down
7 changes: 5 additions & 2 deletions ascon-aead/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
//!
Expand Down Expand Up @@ -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<P: Parameters> {
key: P::InternalKey,
}
Expand Down Expand Up @@ -173,6 +173,7 @@ impl<P: Parameters> AeadInPlace for Ascon<P> {
}

/// Ascon-128
#[derive(Debug)]
pub struct Ascon128(Ascon<Parameters128>);
/// Key for Ascon-128
pub type Ascon128Key = Key<Ascon128>;
Expand Down Expand Up @@ -223,6 +224,7 @@ impl AeadInPlace for Ascon128 {
}

/// Ascon-128a
#[derive(Debug)]
pub struct Ascon128a(Ascon<Parameters128a>);

/// Key for Ascon-128a
Expand Down Expand Up @@ -274,6 +276,7 @@ impl AeadInPlace for Ascon128a {
}

/// Ascon-80pq
#[derive(Debug)]
pub struct Ascon80pq(Ascon<Parameters80pq>);
/// Key for Ascon-80pq
pub type Ascon80pqKey = Key<Ascon80pq>;
Expand Down
4 changes: 2 additions & 2 deletions ccm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
//!
Expand Down Expand Up @@ -91,7 +91,7 @@ impl<T: private::SealedNonce> 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<C, M, N>
where
C: BlockCipher + BlockSizeUser<BlockSize = U16> + BlockEncrypt,
Expand Down
3 changes: 2 additions & 1 deletion chacha20poly1305/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
//!
Expand Down Expand Up @@ -211,6 +211,7 @@ pub type XChaCha12Poly1305 = ChaChaPoly1305<XChaCha12, U24>;
/// 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<C, N: ArrayLength<u8> = U12> {
/// Secret key.
key: Key,
Expand Down
2 changes: 2 additions & 0 deletions deoxys/src/deoxys_bc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion deoxys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
//!
Expand Down Expand Up @@ -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<M, B>
where
M: DeoxysMode<B>,
Expand Down
2 changes: 2 additions & 0 deletions deoxys/src/modes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<B> {
_ptr: PhantomData<B>,
}

/// Implementation of the Deoxys-II mode of operation.
#[allow(clippy::upper_case_acronyms)]
#[derive(Debug)]
pub struct DeoxysII<B> {
_ptr: PhantomData<B>,
}
Expand Down
4 changes: 2 additions & 2 deletions eax/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
//!
Expand Down Expand Up @@ -166,7 +166,7 @@ type Ctr128BE<C> = ctr::CtrCore<C, ctr::flavors::Ctr128BE>;
/// ## Type parameters
/// - `Cipher`: block cipher.
/// - `M`: size of MAC tag, valid values: up to `U16`.
#[derive(Clone)]
#[derive(Debug, Clone)]
pub struct Eax<Cipher, M = U16>
where
Cipher: BlockCipher<BlockSize = U16> + BlockEncrypt + Clone + KeyInit,
Expand Down
4 changes: 4 additions & 0 deletions eax/src/online.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}

Expand Down Expand Up @@ -148,6 +150,7 @@ impl CipherOp for Decrypt {}
/// [`Eax`]: ../struct.Eax.html
/// [`Decrypt`]: struct.Decrypt.html
/// [`finish`]: #method.finish
#[derive(Debug)]
pub struct Eax<Cipher, Op, M = U16>
where
Cipher: BlockCipher<BlockSize = U16> + BlockEncrypt + Clone + KeyInit,
Expand Down Expand Up @@ -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<Cipher, M>
where
Cipher: BlockCipher<BlockSize = U16> + BlockEncrypt + Clone + KeyInit,
Expand Down

0 comments on commit 567072f

Please sign in to comment.