blob: 179c5aec6d2a91e012101f9756ceb7e72f2b30a1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
extern crate commoncrypto;
extern crate hex;
use commoncrypto::pbkdf2::{pbkdf2, CCPseudoRandomAlgorithm};
use hex::ToHex;
#[test]
fn derive_pbkdf2() {
let derived = pbkdf2(b"password",
b"salt",
CCPseudoRandomAlgorithm::kCCPRFHmacAlgSHA1,
1,
20)
.unwrap();
assert_eq!("0c60c80f961f0e71f3a9b524af6012062fe037a6", derived.to_hex());
}
|