From 3cbc5d4a7f3aa990ec59a25b7cafb79f99b3e698 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: Wed, 10 Sep 2025 03:18:01 +0300 Subject: [PATCH 1/2] Remove `Clone` impls --- cbc/src/decrypt.rs | 1 - cbc/src/encrypt.rs | 1 - cfb-mode/src/decrypt.rs | 2 -- cfb-mode/src/encrypt.rs | 1 - cfb-mode/src/encrypt/buf.rs | 1 - cfb8/src/decrypt.rs | 1 - cfb8/src/encrypt.rs | 1 - ctr/src/ctr_core.rs | 14 -------------- cts/src/cbc_cs1.rs | 1 - cts/src/cbc_cs2.rs | 1 - cts/src/cbc_cs3.rs | 1 - cts/src/ecb_cs1.rs | 1 - cts/src/ecb_cs2.rs | 1 - cts/src/ecb_cs3.rs | 1 - ige/src/decrypt.rs | 1 - ige/src/encrypt.rs | 1 - ofb/src/lib.rs | 1 - pcbc/src/decrypt.rs | 1 - pcbc/src/encrypt.rs | 1 - 19 files changed, 33 deletions(-) diff --git a/cbc/src/decrypt.rs b/cbc/src/decrypt.rs index 4ba8e22..24e0bd8 100644 --- a/cbc/src/decrypt.rs +++ b/cbc/src/decrypt.rs @@ -13,7 +13,6 @@ use core::fmt; use cipher::zeroize::{Zeroize, ZeroizeOnDrop}; /// CBC mode decryptor. -#[derive(Clone)] pub struct Decryptor where C: BlockCipherDecrypt, diff --git a/cbc/src/encrypt.rs b/cbc/src/encrypt.rs index 0b0c39e..183688c 100644 --- a/cbc/src/encrypt.rs +++ b/cbc/src/encrypt.rs @@ -12,7 +12,6 @@ use core::fmt; use cipher::zeroize::{Zeroize, ZeroizeOnDrop}; /// CBC mode encryptor. -#[derive(Clone)] pub struct Encryptor where C: BlockCipherEncrypt, diff --git a/cfb-mode/src/decrypt.rs b/cfb-mode/src/decrypt.rs index 1a3772e..ada1a91 100644 --- a/cfb-mode/src/decrypt.rs +++ b/cfb-mode/src/decrypt.rs @@ -12,7 +12,6 @@ use core::fmt; use cipher::zeroize::{Zeroize, ZeroizeOnDrop}; /// CFB mode decryptor. -#[derive(Clone)] pub struct Decryptor where C: BlockCipherEncrypt, @@ -22,7 +21,6 @@ where } /// CFB mode buffered decryptor. -#[derive(Clone)] pub struct BufDecryptor where C: BlockCipherEncrypt, diff --git a/cfb-mode/src/encrypt.rs b/cfb-mode/src/encrypt.rs index d69f4cf..e148617 100644 --- a/cfb-mode/src/encrypt.rs +++ b/cfb-mode/src/encrypt.rs @@ -16,7 +16,6 @@ mod buf; pub use buf::BufEncryptor; /// CFB mode encryptor. -#[derive(Clone)] pub struct Encryptor where C: BlockCipherEncrypt, diff --git a/cfb-mode/src/encrypt/buf.rs b/cfb-mode/src/encrypt/buf.rs index 8cc553e..18f688a 100644 --- a/cfb-mode/src/encrypt/buf.rs +++ b/cfb-mode/src/encrypt/buf.rs @@ -9,7 +9,6 @@ use core::fmt; use cipher::zeroize::{Zeroize, ZeroizeOnDrop}; /// CFB mode buffered encryptor. -#[derive(Clone)] pub struct BufEncryptor where C: BlockCipherEncrypt, diff --git a/cfb8/src/decrypt.rs b/cfb8/src/decrypt.rs index 8163a80..595076f 100644 --- a/cfb8/src/decrypt.rs +++ b/cfb8/src/decrypt.rs @@ -13,7 +13,6 @@ use core::fmt; use cipher::zeroize::{Zeroize, ZeroizeOnDrop}; /// CFB-8 mode decryptor. -#[derive(Clone)] pub struct Decryptor where C: BlockCipherEncrypt, diff --git a/cfb8/src/encrypt.rs b/cfb8/src/encrypt.rs index 7040943..360fc64 100644 --- a/cfb8/src/encrypt.rs +++ b/cfb8/src/encrypt.rs @@ -13,7 +13,6 @@ use core::fmt; use cipher::zeroize::{Zeroize, ZeroizeOnDrop}; /// CFB-8 mode encryptor. -#[derive(Clone)] pub struct Encryptor where C: BlockCipherEncrypt, diff --git a/ctr/src/ctr_core.rs b/ctr/src/ctr_core.rs index 12aeff7..629191a 100644 --- a/ctr/src/ctr_core.rs +++ b/ctr/src/ctr_core.rs @@ -151,20 +151,6 @@ where } } -impl Clone for CtrCore -where - C: BlockCipherEncrypt + Clone, - F: CtrFlavor, -{ - #[inline] - fn clone(&self) -> Self { - Self { - cipher: self.cipher.clone(), - ctr_nonce: self.ctr_nonce.clone(), - } - } -} - impl fmt::Debug for CtrCore where C: BlockCipherEncrypt + AlgorithmName, diff --git a/cts/src/cbc_cs1.rs b/cts/src/cbc_cs1.rs index 9d4a6b6..2790a4c 100644 --- a/cts/src/cbc_cs1.rs +++ b/cts/src/cbc_cs1.rs @@ -9,7 +9,6 @@ use cipher::{ }; /// The CBC-CS-1 ciphertext stealing mode. -#[derive(Clone)] pub struct CbcCs1 { cipher: C, iv: Block, diff --git a/cts/src/cbc_cs2.rs b/cts/src/cbc_cs2.rs index e6cfcfb..1f64d58 100644 --- a/cts/src/cbc_cs2.rs +++ b/cts/src/cbc_cs2.rs @@ -9,7 +9,6 @@ use cipher::{ }; /// The CBC-CS-2 ciphertext stealing mode. -#[derive(Clone)] pub struct CbcCs2 { cipher: C, iv: Block, diff --git a/cts/src/cbc_cs3.rs b/cts/src/cbc_cs3.rs index 813a96d..ed16227 100644 --- a/cts/src/cbc_cs3.rs +++ b/cts/src/cbc_cs3.rs @@ -9,7 +9,6 @@ use cipher::{ }; /// The CBC-CS-3 ciphertext stealing mode. -#[derive(Clone)] pub struct CbcCs3 { cipher: C, iv: Block, diff --git a/cts/src/ecb_cs1.rs b/cts/src/ecb_cs1.rs index 54d070a..b7b12be 100644 --- a/cts/src/ecb_cs1.rs +++ b/cts/src/ecb_cs1.rs @@ -10,7 +10,6 @@ use cipher::{ }; /// The ECB-CS-1 ciphertext stealing mode. -#[derive(Clone)] pub struct EcbCs1 { cipher: C, } diff --git a/cts/src/ecb_cs2.rs b/cts/src/ecb_cs2.rs index d7f5649..06db147 100644 --- a/cts/src/ecb_cs2.rs +++ b/cts/src/ecb_cs2.rs @@ -10,7 +10,6 @@ use cipher::{ }; /// The ECB-CS-2 ciphertext stealing mode. -#[derive(Clone)] pub struct EcbCs2 { cipher: C, } diff --git a/cts/src/ecb_cs3.rs b/cts/src/ecb_cs3.rs index fa91282..91a96e4 100644 --- a/cts/src/ecb_cs3.rs +++ b/cts/src/ecb_cs3.rs @@ -10,7 +10,6 @@ use cipher::{ }; /// The ECB-CS-3 ciphertext stealing mode. -#[derive(Clone)] pub struct EcbCs3 { cipher: C, } diff --git a/ige/src/decrypt.rs b/ige/src/decrypt.rs index f0097ce..c823d65 100644 --- a/ige/src/decrypt.rs +++ b/ige/src/decrypt.rs @@ -14,7 +14,6 @@ use core::{fmt, ops::Add}; use cipher::zeroize::{Zeroize, ZeroizeOnDrop}; /// IGE mode decryptor. -#[derive(Clone)] pub struct Decryptor where C: BlockCipherDecrypt, diff --git a/ige/src/encrypt.rs b/ige/src/encrypt.rs index a585493..1a09880 100644 --- a/ige/src/encrypt.rs +++ b/ige/src/encrypt.rs @@ -14,7 +14,6 @@ use core::{fmt, ops::Add}; use cipher::zeroize::{Zeroize, ZeroizeOnDrop}; /// IGE mode encryptor. -#[derive(Clone)] pub struct Encryptor where C: BlockCipherEncrypt, diff --git a/ofb/src/lib.rs b/ofb/src/lib.rs index 0b18580..cb4f0e7 100644 --- a/ofb/src/lib.rs +++ b/ofb/src/lib.rs @@ -85,7 +85,6 @@ use cipher::zeroize::{Zeroize, ZeroizeOnDrop}; pub type Ofb = StreamCipherCoreWrapper>; /// Output feedback (OFB) mode. -#[derive(Clone)] pub struct OfbCore where C: BlockCipherEncrypt, diff --git a/pcbc/src/decrypt.rs b/pcbc/src/decrypt.rs index 44f75ad..4813661 100644 --- a/pcbc/src/decrypt.rs +++ b/pcbc/src/decrypt.rs @@ -14,7 +14,6 @@ use core::fmt; use cipher::zeroize::{Zeroize, ZeroizeOnDrop}; /// PCBC mode decryptor. -#[derive(Clone)] pub struct Decryptor where C: BlockCipherDecrypt, diff --git a/pcbc/src/encrypt.rs b/pcbc/src/encrypt.rs index d793802..a42160f 100644 --- a/pcbc/src/encrypt.rs +++ b/pcbc/src/encrypt.rs @@ -14,7 +14,6 @@ use core::fmt; use cipher::zeroize::{Zeroize, ZeroizeOnDrop}; /// PCBC mode encryptor. -#[derive(Clone)] pub struct Encryptor where C: BlockCipherEncrypt, From b19828eebba9422572539905c81af0cf3e4e4c7f 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: Wed, 10 Sep 2025 03:26:06 +0300 Subject: [PATCH 2/2] Update changelogs --- cbc/CHANGELOG.md | 2 ++ cfb-mode/CHANGELOG.md | 2 ++ cfb8/CHANGELOG.md | 2 ++ ctr/CHANGELOG.md | 3 ++- cts/CHANGELOG.md | 2 ++ ige/CHANGELOG.md | 2 ++ ofb/CHANGELOG.md | 2 ++ pcbc/CHANGELOG.md | 2 ++ 8 files changed, 16 insertions(+), 1 deletion(-) diff --git a/cbc/CHANGELOG.md b/cbc/CHANGELOG.md index abe4f69..ad12c63 100644 --- a/cbc/CHANGELOG.md +++ b/cbc/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## 0.2.0 (UNRELEASED) ### Removed - `std` feature ([#76]) +- `Clone` impl ([#91]) ### Changed - Bump `cipher` from `0.4` to `0.5` ([#56]) @@ -16,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [#56]: https://github.com/RustCrypto/block-modes/pull/56 [#76]: https://github.com/RustCrypto/block-modes/pull/76 +[#91]: https://github.com/RustCrypto/block-modes/pull/91 ## 0.1.2 (2022-03-24) ### Changed diff --git a/cfb-mode/CHANGELOG.md b/cfb-mode/CHANGELOG.md index 52098df..8d47ba3 100644 --- a/cfb-mode/CHANGELOG.md +++ b/cfb-mode/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## 0.9.0 (UNRELEASED) ### Removed - `std` feature ([#76]) +- `Clone` impl ([#91]) ### Changed - Bump `cipher` from `0.4` to `0.5` ([#56]) @@ -16,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [#56]: https://github.com/RustCrypto/block-modes/pull/56 [#76]: https://github.com/RustCrypto/block-modes/pull/76 +[#91]: https://github.com/RustCrypto/block-modes/pull/91 ## 0.8.2 (2022-09-13) ### Added diff --git a/cfb8/CHANGELOG.md b/cfb8/CHANGELOG.md index 097a619..aab8816 100644 --- a/cfb8/CHANGELOG.md +++ b/cfb8/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## 0.9.0 (UNRELEASED) ### Removed - `std` feature ([#76]) +- `Clone` impl ([#91]) ### Changed - Bump `cipher` from `0.4` to `0.5` ([#56]) @@ -16,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [#56]: https://github.com/RustCrypto/block-modes/pull/56 [#75]: https://github.com/RustCrypto/block-modes/pull/76 +[#91]: https://github.com/RustCrypto/block-modes/pull/91 ## 0.8.1 (2022-02-17) ### Fixed diff --git a/ctr/CHANGELOG.md b/ctr/CHANGELOG.md index 6d89cf9..dd923f4 100644 --- a/ctr/CHANGELOG.md +++ b/ctr/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## 0.10.0 (UNRELEASED) ### Removed - `std` feature ([#76]) +- `Clone` impl ([#91]) ### Changed - Bump `cipher` from `0.4` to `0.5` ([#56]) @@ -16,7 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [#56]: https://github.com/RustCrypto/block-modes/pull/56 [#76]: https://github.com/RustCrypto/block-modes/pull/76 - +[#91]: https://github.com/RustCrypto/block-modes/pull/91 ## 0.9.2 (2022-09-30) ### Changed diff --git a/cts/CHANGELOG.md b/cts/CHANGELOG.md index ef7cc7f..88d1323 100644 --- a/cts/CHANGELOG.md +++ b/cts/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## 0.7.0 (UNRELEASED) ### Removed - `std` feature ([#76]) +- `Clone` impl ([#91]) ### Changed - Update to cipher v0.5 ([#72]) @@ -17,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [#72]: https://github.com/RustCrypto/block-modes/pull/72 [#76]: https://github.com/RustCrypto/block-modes/pull/76 +[#91]: https://github.com/RustCrypto/block-modes/pull/91 ## 0.6.0 (2024-11-01) - Initial release ([#70]) diff --git a/ige/CHANGELOG.md b/ige/CHANGELOG.md index fe27df6..a238ec8 100644 --- a/ige/CHANGELOG.md +++ b/ige/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## 0.2.0 (UNRELEASED) ### Removed - `std` feature ([#76]) +- `Clone` impl ([#91]) ### Changed - Bump `cipher` from `0.4` to `0.5` ([#56]) @@ -16,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [#56]: https://github.com/RustCrypto/block-modes/pull/56 [#76]: https://github.com/RustCrypto/block-modes/pull/76 +[#91]: https://github.com/RustCrypto/block-modes/pull/91 ## 0.1.1 (2022-02-17) ### Fixed diff --git a/ofb/CHANGELOG.md b/ofb/CHANGELOG.md index 4534b52..8d173cd 100644 --- a/ofb/CHANGELOG.md +++ b/ofb/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## 0.7.0 (UNRELEASED) ### Removed - `std` feature ([#76]) +- `Clone` impl ([#91]) ### Changed - Bump `cipher` from `0.4` to `0.5` ([#56]) @@ -16,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [#56]: https://github.com/RustCrypto/block-modes/pull/56 [#76]: https://github.com/RustCrypto/block-modes/pull/76 +[#91]: https://github.com/RustCrypto/block-modes/pull/91 ## 0.6.1 (2022-02-17) ### Fixed diff --git a/pcbc/CHANGELOG.md b/pcbc/CHANGELOG.md index 4701498..fb557b5 100644 --- a/pcbc/CHANGELOG.md +++ b/pcbc/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## 0.2.0 (UNRELEASED) ### Removed - `std` feature ([#76]) +- `Clone` impl ([#91]) ### Changed - Bump `cipher` from `0.4` to `0.5` ([#56]) @@ -16,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [#56]: https://github.com/RustCrypto/block-modes/pull/56 [#76]: https://github.com/RustCrypto/block-modes/pull/76 +[#91]: https://github.com/RustCrypto/block-modes/pull/91 ## 0.1.2 (2022-03-24) ### Changed