aboutsummaryrefslogtreecommitdiff
path: root/src/crypto/pkcs5.rs
diff options
context:
space:
mode:
authorAlex Crichton <[email protected]>2015-01-09 08:07:39 -0800
committerAlex Crichton <[email protected]>2015-01-09 08:12:39 -0800
commit9dfeea6ca9f8527e8be56c208e21a1a48f22f6cf (patch)
treee26eea29b731b0c6df36847923e3a51b5bb048a4 /src/crypto/pkcs5.rs
parentMerge pull request #139 from vhbit/up-master (diff)
downloadrust-openssl-9dfeea6ca9f8527e8be56c208e21a1a48f22f6cf.tar.xz
rust-openssl-9dfeea6ca9f8527e8be56c208e21a1a48f22f6cf.zip
Update to rust master
Diffstat (limited to 'src/crypto/pkcs5.rs')
-rw-r--r--src/crypto/pkcs5.rs26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/crypto/pkcs5.rs b/src/crypto/pkcs5.rs
index 6efd23ff..b101c3ed 100644
--- a/src/crypto/pkcs5.rs
+++ b/src/crypto/pkcs5.rs
@@ -2,7 +2,7 @@ use libc::c_int;
use ffi;
/// Derives a key from a password and salt using the PBKDF2-HMAC-SHA1 algorithm.
-pub fn pbkdf2_hmac_sha1(pass: &str, salt: &[u8], iter: uint, keylen: uint) -> Vec<u8> {
+pub fn pbkdf2_hmac_sha1(pass: &str, salt: &[u8], iter: usize, keylen: usize) -> Vec<u8> {
unsafe {
assert!(iter >= 1);
assert!(keylen >= 1);
@@ -35,8 +35,8 @@ mod tests {
super::pbkdf2_hmac_sha1(
"password",
"salt".as_bytes(),
- 1u,
- 20u
+ 1,
+ 20
),
vec!(
0x0c_u8, 0x60_u8, 0xc8_u8, 0x0f_u8, 0x96_u8, 0x1f_u8, 0x0e_u8,
@@ -49,8 +49,8 @@ mod tests {
super::pbkdf2_hmac_sha1(
"password",
"salt".as_bytes(),
- 2u,
- 20u
+ 2,
+ 20
),
vec!(
0xea_u8, 0x6c_u8, 0x01_u8, 0x4d_u8, 0xc7_u8, 0x2d_u8, 0x6f_u8,
@@ -63,8 +63,8 @@ mod tests {
super::pbkdf2_hmac_sha1(
"password",
"salt".as_bytes(),
- 4096u,
- 20u
+ 4096,
+ 20
),
vec!(
0x4b_u8, 0x00_u8, 0x79_u8, 0x01_u8, 0xb7_u8, 0x65_u8, 0x48_u8,
@@ -77,8 +77,8 @@ mod tests {
super::pbkdf2_hmac_sha1(
"password",
"salt".as_bytes(),
- 16777216u,
- 20u
+ 16777216,
+ 20
),
vec!(
0xee_u8, 0xfe_u8, 0x3d_u8, 0x61_u8, 0xcd_u8, 0x4d_u8, 0xa4_u8,
@@ -91,8 +91,8 @@ mod tests {
super::pbkdf2_hmac_sha1(
"passwordPASSWORDpassword",
"saltSALTsaltSALTsaltSALTsaltSALTsalt".as_bytes(),
- 4096u,
- 25u
+ 4096,
+ 25
),
vec!(
0x3d_u8, 0x2e_u8, 0xec_u8, 0x4f_u8, 0xe4_u8, 0x1c_u8, 0x84_u8,
@@ -106,8 +106,8 @@ mod tests {
super::pbkdf2_hmac_sha1(
"pass\x00word",
"sa\x00lt".as_bytes(),
- 4096u,
- 16u
+ 4096,
+ 16
),
vec!(
0x56_u8, 0xfa_u8, 0x6a_u8, 0xa7_u8, 0x55_u8, 0x48_u8, 0x09_u8,