Skip to content

Commit dd15f84

Browse files
authored
pbkdf2: remove unnecessary bounds (#700)
1 parent 6c83054 commit dd15f84

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

pbkdf2/src/lib.rs

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,7 @@ use rayon::prelude::*;
102102
use digest::{FixedOutput, InvalidLength, KeyInit, Update, typenum::Unsigned};
103103

104104
#[cfg(feature = "hmac")]
105-
use {
106-
digest::{
107-
HashMarker,
108-
block_api::BlockSizeUser,
109-
typenum::{IsLess, NonZero, True, U256},
110-
},
111-
hmac::EagerHash,
112-
};
105+
use hmac::EagerHash;
113106

114107
#[inline(always)]
115108
fn xor(res: &mut [u8], salt: &[u8]) {
@@ -230,9 +223,7 @@ where
230223
#[cfg(feature = "hmac")]
231224
pub fn pbkdf2_hmac<D>(password: &[u8], salt: &[u8], rounds: u32, res: &mut [u8])
232225
where
233-
D: EagerHash + HashMarker + Update + FixedOutput + Default + Clone,
234-
<D as EagerHash>::Core: Sync,
235-
<D as BlockSizeUser>::BlockSize: IsLess<U256, Output = True> + NonZero,
226+
D: EagerHash<Core: Sync>,
236227
{
237228
crate::pbkdf2::<hmac::Hmac<D>>(password, salt, rounds, res)
238229
.expect("HMAC can be initialized with any key length");
@@ -254,9 +245,7 @@ where
254245
#[cfg(feature = "hmac")]
255246
pub fn pbkdf2_hmac_array<D, const N: usize>(password: &[u8], salt: &[u8], rounds: u32) -> [u8; N]
256247
where
257-
D: EagerHash + HashMarker + Update + FixedOutput + Default + Clone,
258-
<D as EagerHash>::Core: Sync,
259-
<D as BlockSizeUser>::BlockSize: IsLess<U256, Output = True> + NonZero,
248+
D: EagerHash<Core: Sync>,
260249
{
261250
let mut buf = [0u8; N];
262251
pbkdf2_hmac::<D>(password, salt, rounds, &mut buf);

0 commit comments

Comments
 (0)