@@ -103,11 +103,13 @@ use rayon::prelude::*;
103103use digest:: { FixedOutput , InvalidLength , KeyInit , Update , typenum:: Unsigned } ;
104104
105105#[ cfg( feature = "hmac" ) ]
106- use digest:: {
107- HashMarker ,
108- block_buffer:: Eager ,
109- core_api:: { BlockSizeUser , BufferKindUser , FixedOutputCore , UpdateCore } ,
110- typenum:: { IsLess , Le , NonZero , U256 } ,
106+ use {
107+ digest:: {
108+ HashMarker ,
109+ block_api:: BlockSizeUser ,
110+ typenum:: { IsLess , NonZero , True , U256 } ,
111+ } ,
112+ hmac:: block_api:: EagerHash ,
111113} ;
112114
113115#[ inline( always) ]
@@ -230,16 +232,9 @@ where
230232#[ cfg_attr( docsrs, doc( cfg( feature = "hmac" ) ) ) ]
231233pub fn pbkdf2_hmac < D > ( password : & [ u8 ] , salt : & [ u8 ] , rounds : u32 , res : & mut [ u8 ] )
232234where
233- D : hmac:: EagerHash ,
234- D :: Core : Sync
235- + HashMarker
236- + UpdateCore
237- + FixedOutputCore
238- + BufferKindUser < BufferKind = Eager >
239- + Default
240- + Clone ,
241- <D :: Core as BlockSizeUser >:: BlockSize : IsLess < U256 > ,
242- Le < <D :: Core as BlockSizeUser >:: BlockSize , U256 > : NonZero ,
235+ D : EagerHash + HashMarker + Update + FixedOutput + Default + Clone ,
236+ <D as EagerHash >:: Core : Sync ,
237+ <D as BlockSizeUser >:: BlockSize : IsLess < U256 , Output = True > + NonZero ,
243238{
244239 crate :: pbkdf2 :: < hmac:: Hmac < D > > ( password, salt, rounds, res)
245240 . expect ( "HMAC can be initialized with any key length" ) ;
@@ -262,16 +257,9 @@ where
262257#[ cfg_attr( docsrs, doc( cfg( feature = "hmac" ) ) ) ]
263258pub fn pbkdf2_hmac_array < D , const N : usize > ( password : & [ u8 ] , salt : & [ u8 ] , rounds : u32 ) -> [ u8 ; N ]
264259where
265- D : hmac:: EagerHash ,
266- D :: Core : Sync
267- + HashMarker
268- + UpdateCore
269- + FixedOutputCore
270- + BufferKindUser < BufferKind = Eager >
271- + Default
272- + Clone ,
273- <D :: Core as BlockSizeUser >:: BlockSize : IsLess < U256 > ,
274- Le < <D :: Core as BlockSizeUser >:: BlockSize , U256 > : NonZero ,
260+ D : EagerHash + HashMarker + Update + FixedOutput + Default + Clone ,
261+ <D as EagerHash >:: Core : Sync ,
262+ <D as BlockSizeUser >:: BlockSize : IsLess < U256 , Output = True > + NonZero ,
275263{
276264 let mut buf = [ 0u8 ; N ] ;
277265 pbkdf2_hmac :: < D > ( password, salt, rounds, & mut buf) ;
0 commit comments