Skip to content

Commit 0f92e05

Browse files
authored
Remove Clone impls (#91)
Cloning of a block mode state can be considered a footgun. If state has to be cloned for some reason, users should prefer passing key/IV instead (see the `IvState` trait).
1 parent 2812bb7 commit 0f92e05

27 files changed

Lines changed: 16 additions & 34 deletions

cbc/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
## 0.2.0 (UNRELEASED)
99
### Removed
1010
- `std` feature ([#76])
11+
- `Clone` impl ([#91])
1112

1213
### Changed
1314
- 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
1617

1718
[#56]: https://github.com/RustCrypto/block-modes/pull/56
1819
[#76]: https://github.com/RustCrypto/block-modes/pull/76
20+
[#91]: https://github.com/RustCrypto/block-modes/pull/91
1921

2022
## 0.1.2 (2022-03-24)
2123
### Changed

cbc/src/decrypt.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ use core::fmt;
1313
use cipher::zeroize::{Zeroize, ZeroizeOnDrop};
1414

1515
/// CBC mode decryptor.
16-
#[derive(Clone)]
1716
pub struct Decryptor<C>
1817
where
1918
C: BlockCipherDecrypt,

cbc/src/encrypt.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use core::fmt;
1212
use cipher::zeroize::{Zeroize, ZeroizeOnDrop};
1313

1414
/// CBC mode encryptor.
15-
#[derive(Clone)]
1615
pub struct Encryptor<C>
1716
where
1817
C: BlockCipherEncrypt,

cfb-mode/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
## 0.9.0 (UNRELEASED)
99
### Removed
1010
- `std` feature ([#76])
11+
- `Clone` impl ([#91])
1112

1213
### Changed
1314
- 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
1617

1718
[#56]: https://github.com/RustCrypto/block-modes/pull/56
1819
[#76]: https://github.com/RustCrypto/block-modes/pull/76
20+
[#91]: https://github.com/RustCrypto/block-modes/pull/91
1921

2022
## 0.8.2 (2022-09-13)
2123
### Added

cfb-mode/src/decrypt.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use core::fmt;
1212
use cipher::zeroize::{Zeroize, ZeroizeOnDrop};
1313

1414
/// CFB mode decryptor.
15-
#[derive(Clone)]
1615
pub struct Decryptor<C>
1716
where
1817
C: BlockCipherEncrypt,
@@ -22,7 +21,6 @@ where
2221
}
2322

2423
/// CFB mode buffered decryptor.
25-
#[derive(Clone)]
2624
pub struct BufDecryptor<C>
2725
where
2826
C: BlockCipherEncrypt,

cfb-mode/src/encrypt.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ mod buf;
1616
pub use buf::BufEncryptor;
1717

1818
/// CFB mode encryptor.
19-
#[derive(Clone)]
2019
pub struct Encryptor<C>
2120
where
2221
C: BlockCipherEncrypt,

cfb-mode/src/encrypt/buf.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use core::fmt;
99
use cipher::zeroize::{Zeroize, ZeroizeOnDrop};
1010

1111
/// CFB mode buffered encryptor.
12-
#[derive(Clone)]
1312
pub struct BufEncryptor<C>
1413
where
1514
C: BlockCipherEncrypt,

cfb8/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
## 0.9.0 (UNRELEASED)
99
### Removed
1010
- `std` feature ([#76])
11+
- `Clone` impl ([#91])
1112

1213
### Changed
1314
- 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
1617

1718
[#56]: https://github.com/RustCrypto/block-modes/pull/56
1819
[#75]: https://github.com/RustCrypto/block-modes/pull/76
20+
[#91]: https://github.com/RustCrypto/block-modes/pull/91
1921

2022
## 0.8.1 (2022-02-17)
2123
### Fixed

cfb8/src/decrypt.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ use core::fmt;
1313
use cipher::zeroize::{Zeroize, ZeroizeOnDrop};
1414

1515
/// CFB-8 mode decryptor.
16-
#[derive(Clone)]
1716
pub struct Decryptor<C>
1817
where
1918
C: BlockCipherEncrypt,

cfb8/src/encrypt.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ use core::fmt;
1313
use cipher::zeroize::{Zeroize, ZeroizeOnDrop};
1414

1515
/// CFB-8 mode encryptor.
16-
#[derive(Clone)]
1716
pub struct Encryptor<C>
1817
where
1918
C: BlockCipherEncrypt,

0 commit comments

Comments
 (0)