Skip to content

Commit bdeaf6d

Browse files
committed
Use BlockCipherEncrypt/BlockCipherDecrypt trait names
Updates the previous `BlockEncrypt`/`BlockEncrypt` trait names to use the new ones introduced in RustCrypto/traits#1482
1 parent 6556a18 commit bdeaf6d

26 files changed

Lines changed: 54 additions & 52 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,6 @@ members = [
2323

2424
[profile.dev]
2525
opt-level = 2
26+
27+
[patch.crates-io.cipher]
28+
git = "https://github.com/RustCrypto/traits.git"

aes/src/armv8.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use crate::{Block, Block8};
2525
use cipher::{
2626
consts::{U16, U24, U32, U8},
2727
inout::InOut,
28-
AlgorithmName, BlockBackend, BlockCipher, BlockClosure, BlockDecrypt, BlockEncrypt,
28+
AlgorithmName, BlockBackend, BlockCipher, BlockClosure, BlockCipherDecrypt, BlockCipherEncrypt,
2929
BlockSizeUser, Key, KeyInit, KeySizeUser, ParBlocksSizeUser,
3030
};
3131
use core::arch::aarch64::*;
@@ -98,13 +98,13 @@ macro_rules! define_aes_impl {
9898
type BlockSize = U16;
9999
}
100100

101-
impl BlockEncrypt for $name {
101+
impl BlockCipherEncrypt for $name {
102102
fn encrypt_with_backend(&self, f: impl BlockClosure<BlockSize = U16>) {
103103
self.encrypt.encrypt_with_backend(f)
104104
}
105105
}
106106

107-
impl BlockDecrypt for $name {
107+
impl BlockCipherDecrypt for $name {
108108
fn decrypt_with_backend(&self, f: impl BlockClosure<BlockSize = U16>) {
109109
self.decrypt.decrypt_with_backend(f)
110110
}
@@ -158,7 +158,7 @@ macro_rules! define_aes_impl {
158158
type BlockSize = U16;
159159
}
160160

161-
impl BlockEncrypt for $name_enc {
161+
impl BlockCipherEncrypt for $name_enc {
162162
fn encrypt_with_backend(&self, f: impl BlockClosure<BlockSize = U16>) {
163163
f.call(&mut self.get_enc_backend())
164164
}
@@ -233,7 +233,7 @@ macro_rules! define_aes_impl {
233233
type BlockSize = U16;
234234
}
235235

236-
impl BlockDecrypt for $name_dec {
236+
impl BlockCipherDecrypt for $name_dec {
237237
fn decrypt_with_backend(&self, f: impl BlockClosure<BlockSize = U16>) {
238238
f.call(&mut self.get_dec_backend());
239239
}

aes/src/autodetect.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use crate::soft;
55
use cipher::{
66
consts::{U16, U24, U32},
7-
AlgorithmName, BlockCipher, BlockClosure, BlockDecrypt, BlockEncrypt, BlockSizeUser, Key,
7+
AlgorithmName, BlockCipher, BlockClosure, BlockCipherDecrypt, BlockCipherEncrypt, BlockSizeUser, Key,
88
KeyInit, KeySizeUser,
99
};
1010
use core::fmt;
@@ -130,7 +130,7 @@ macro_rules! define_aes_impl {
130130

131131
impl BlockCipher for $name {}
132132

133-
impl BlockEncrypt for $name {
133+
impl BlockCipherEncrypt for $name {
134134
fn encrypt_with_backend(&self, f: impl BlockClosure<BlockSize = U16>) {
135135
unsafe {
136136
if self.token.get() {
@@ -149,7 +149,7 @@ macro_rules! define_aes_impl {
149149
}
150150
}
151151

152-
impl BlockDecrypt for $name {
152+
impl BlockCipherDecrypt for $name {
153153
fn decrypt_with_backend(&self, f: impl BlockClosure<BlockSize = U16>) {
154154
unsafe {
155155
if self.token.get() {
@@ -249,7 +249,7 @@ macro_rules! define_aes_impl {
249249

250250
impl BlockCipher for $name_enc {}
251251

252-
impl BlockEncrypt for $name_enc {
252+
impl BlockCipherEncrypt for $name_enc {
253253
fn encrypt_with_backend(&self, f: impl BlockClosure<BlockSize = U16>) {
254254
unsafe {
255255
if self.token.get() {
@@ -378,7 +378,7 @@ macro_rules! define_aes_impl {
378378

379379
impl BlockCipher for $name_dec {}
380380

381-
impl BlockDecrypt for $name_dec {
381+
impl BlockCipherDecrypt for $name_dec {
382382
fn decrypt_with_backend(&self, f: impl BlockClosure<BlockSize = U16>) {
383383
unsafe {
384384
if self.token.get() {

aes/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
//! ```
5353
//! use aes::Aes128;
5454
//! use aes::cipher::{
55-
//! BlockCipher, BlockEncrypt, BlockDecrypt, KeyInit,
55+
//! BlockCipher, BlockCipherEncrypt, BlockCipherDecrypt, KeyInit,
5656
//! array::Array,
5757
//! };
5858
//!

aes/src/ni.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ use crate::{Block, Block8};
3737
use cipher::{
3838
consts::{U16, U24, U32, U8},
3939
inout::InOut,
40-
AlgorithmName, BlockBackend, BlockCipher, BlockClosure, BlockDecrypt, BlockEncrypt,
40+
AlgorithmName, BlockBackend, BlockCipher, BlockClosure, BlockCipherDecrypt, BlockCipherEncrypt,
4141
BlockSizeUser, Key, KeyInit, KeySizeUser, ParBlocksSizeUser,
4242
};
4343
use core::fmt;
@@ -109,13 +109,13 @@ macro_rules! define_aes_impl {
109109
type BlockSize = U16;
110110
}
111111

112-
impl BlockEncrypt for $name {
112+
impl BlockCipherEncrypt for $name {
113113
fn encrypt_with_backend(&self, f: impl BlockClosure<BlockSize = U16>) {
114114
self.encrypt.encrypt_with_backend(f)
115115
}
116116
}
117117

118-
impl BlockDecrypt for $name {
118+
impl BlockCipherDecrypt for $name {
119119
fn decrypt_with_backend(&self, f: impl BlockClosure<BlockSize = U16>) {
120120
self.decrypt.decrypt_with_backend(f)
121121
}
@@ -171,7 +171,7 @@ macro_rules! define_aes_impl {
171171
type BlockSize = U16;
172172
}
173173

174-
impl BlockEncrypt for $name_enc {
174+
impl BlockCipherEncrypt for $name_enc {
175175
fn encrypt_with_backend(&self, f: impl BlockClosure<BlockSize = U16>) {
176176
f.call(&mut self.get_enc_backend())
177177
}
@@ -246,7 +246,7 @@ macro_rules! define_aes_impl {
246246
type BlockSize = U16;
247247
}
248248

249-
impl BlockDecrypt for $name_dec {
249+
impl BlockCipherDecrypt for $name_dec {
250250
fn decrypt_with_backend(&self, f: impl BlockClosure<BlockSize = U16>) {
251251
f.call(&mut self.get_dec_backend());
252252
}

aes/src/soft.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use crate::Block;
1616
use cipher::{
1717
consts::{U16, U24, U32},
1818
inout::InOut,
19-
AlgorithmName, BlockBackend, BlockCipher, BlockClosure, BlockDecrypt, BlockEncrypt,
19+
AlgorithmName, BlockBackend, BlockCipher, BlockClosure, BlockCipherDecrypt, BlockCipherEncrypt,
2020
BlockSizeUser, Key, KeyInit, KeySizeUser, ParBlocksSizeUser,
2121
};
2222
use core::fmt;
@@ -74,13 +74,13 @@ macro_rules! define_aes_impl {
7474

7575
impl BlockCipher for $name {}
7676

77-
impl BlockEncrypt for $name {
77+
impl BlockCipherEncrypt for $name {
7878
fn encrypt_with_backend(&self, f: impl BlockClosure<BlockSize = U16>) {
7979
f.call(&mut self.get_enc_backend())
8080
}
8181
}
8282

83-
impl BlockDecrypt for $name {
83+
impl BlockCipherDecrypt for $name {
8484
fn decrypt_with_backend(&self, f: impl BlockClosure<BlockSize = U16>) {
8585
f.call(&mut self.get_dec_backend())
8686
}
@@ -155,7 +155,7 @@ macro_rules! define_aes_impl {
155155
type BlockSize = U16;
156156
}
157157

158-
impl BlockEncrypt for $name_enc {
158+
impl BlockCipherEncrypt for $name_enc {
159159
fn encrypt_with_backend(&self, f: impl BlockClosure<BlockSize = U16>) {
160160
f.call(&mut self.get_enc_backend())
161161
}
@@ -224,7 +224,7 @@ macro_rules! define_aes_impl {
224224
type BlockSize = U16;
225225
}
226226

227-
impl BlockDecrypt for $name_dec {
227+
impl BlockCipherDecrypt for $name_dec {
228228
fn decrypt_with_backend(&self, f: impl BlockClosure<BlockSize = U16>) {
229229
f.call(&mut self.get_dec_backend());
230230
}

aria/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//! # Examples
1212
//! ```
1313
//! use aria::cipher::array::Array;
14-
//! use aria::cipher::{Key, Block, BlockEncrypt, BlockDecrypt, KeyInit};
14+
//! use aria::cipher::{Key, Block, BlockCipherEncrypt, BlockCipherDecrypt, KeyInit};
1515
//! use aria::Aria128;
1616
//!
1717
//! let key = Array::from([0u8; 16]);

aria/tests/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use aria::{Aria128, Aria192, Aria256};
2-
use cipher::{array::Array, BlockDecrypt, BlockEncrypt, KeyInit};
2+
use cipher::{array::Array, BlockCipherDecrypt, BlockCipherEncrypt, KeyInit};
33
use hex_literal::hex;
44

55
/// Test vector from RFC 5794, Appendix A.1

belt-block/tests/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use belt_block::{belt_block_raw, belt_wblock_dec, belt_wblock_enc, to_u32};
44
#[cfg(feature = "cipher")]
55
use belt_block::{
6-
cipher::{BlockDecrypt, BlockEncrypt, KeyInit},
6+
cipher::{BlockCipherDecrypt, BlockCipherEncrypt, KeyInit},
77
BeltBlock,
88
};
99
use hex_literal::hex;

0 commit comments

Comments
 (0)