@@ -100,18 +100,23 @@ mod tests {
100100 }
101101
102102 #[ test]
103- fn rfc_6070_vector_1 ( ) {
103+ fn pbkdf2_sha384_vector ( ) {
104104 let dk = pbkdf2 ( & HmacAlgorithm :: HMAC_SHA2_384 , b"password" , b"salt" , 1 , 20 ) . unwrap ( ) ;
105105 let expected = [
106- 0xc0 , 0xe1 , 0x4f , 0x06 , 0xe4 , 0x9e , 0x32 , 0xd7 , 0x3f , 0x9f , 0x52 , 0xdd , 0xf1 , 0xd0 ,
107- 0xc5 , 0xc7 , 0x19 , 0x16 , 0x09 , 0x23 ,
106+ 0xc0 , 0xe1 , 0x4f , 0x06 , 0xe4 , 0x9e , 0x32 , 0xd7 ,
107+ 0x3f , 0x9f , 0x52 , 0xdd , 0xf1 , 0xd0 , 0xc5 , 0xc7 ,
108+ 0x19 , 0x16 , 0x09 , 0x23 ,
108109 ] ;
109110 assert_eq ! ( dk, expected) ;
111+ }
110112
113+ #[ test]
114+ fn pbkdf2_sha512_vector ( ) {
111115 let dk = pbkdf2 ( & HmacAlgorithm :: HMAC_SHA2_512 , b"password" , b"salt" , 1 , 20 ) . unwrap ( ) ;
112116 let expected = [
113- 0x86 , 0x7f , 0x70 , 0xcf , 0x1a , 0xde , 0x02 , 0xcf , 0xf3 , 0x75 , 0x25 , 0x99 , 0xa3 , 0xa5 ,
114- 0x3d , 0xc4 , 0xaf , 0x34 , 0xc7 , 0xa6 ,
117+ 0x86 , 0x7f , 0x70 , 0xcf , 0x1a , 0xde , 0x02 , 0xcf ,
118+ 0xf3 , 0x75 , 0x25 , 0x99 , 0xa3 , 0xa5 , 0x3d , 0xc4 ,
119+ 0xaf , 0x34 , 0xc7 , 0xa6 ,
115120 ] ;
116121 assert_eq ! ( dk, expected) ;
117122 }
0 commit comments