Loading hash.rs +3 −4 Original line number Diff line number Diff line Loading @@ -109,7 +109,6 @@ mod tests { use super::*; use hex::FromHex; use hex::ToHex; use std::vec; struct HashTest { input: ~[u8], Loading Loading @@ -152,7 +151,7 @@ mod tests { HashTest(~"A510CD18F7A56852EB0319", ~"577E216843DD11573574D3FB209B97D8"), HashTest(~"AAED18DBE8938C19ED734A8D", ~"6F80FB775F27E0A4CE5C2F42FC72C5F1")]; for vec::each(tests) |test| { for tests.iter().advance |test| { hash_test(MD5, test); } } Loading @@ -164,7 +163,7 @@ mod tests { HashTest(~"616263", ~"A9993E364706816ABA3E25717850C26C9CD0D89D"), ]; for vec::each(tests) |test| { for tests.iter().advance |test| { hash_test(SHA1, test); } } Loading @@ -175,7 +174,7 @@ mod tests { HashTest(~"616263", ~"BA7816BF8F01CFEA414140DE5DAE2223B00361A396177A9CB410FF61F20015AD") ]; for vec::each(tests) |test| { for tests.iter().advance |test| { hash_test(SHA256, test); } } Loading hex.rs +1 −1 Original line number Diff line number Diff line Loading @@ -58,7 +58,7 @@ impl<'self> FromHex for &'self str { else { fail!(~"bad hex character"); }; if i % 2 == 0 { vec::push(&mut vec, nibble << 4); vec.push(nibble << 4); } else { vec[i/2] |= nibble; Loading pkey.rs +4 −4 Original line number Diff line number Diff line Loading @@ -110,7 +110,7 @@ impl PKey { f(self.evp, &ps) }; vec::slice(s, 0u, r as uint).to_owned() s.slice(0u, r as uint).to_owned() } priv unsafe fn _fromstr( Loading Loading @@ -256,7 +256,7 @@ impl PKey { if rv < 0 as c_int { ~[] } else { vec::slice(r, 0u, rv as uint).to_owned() r.slice(0u, rv as uint).to_owned() } } } Loading Loading @@ -285,7 +285,7 @@ impl PKey { if rv < 0 as c_int { ~[] } else { vec::slice(r, 0u, rv as uint).to_owned() r.slice(0u, rv as uint).to_owned() } } } Loading Loading @@ -334,7 +334,7 @@ impl PKey { if rv < 0 as c_int { ~[] } else { vec::slice(r, 0u, len as uint).to_owned() r.slice(0u, len as uint).to_owned() } } } Loading symm.rs +2 −2 Original line number Diff line number Diff line Loading @@ -148,7 +148,7 @@ impl Crypter { reslen }; vec::slice(res, 0u, reslen as uint).to_owned() res.slice(0u, reslen as uint).to_owned() } } } Loading @@ -166,7 +166,7 @@ impl Crypter { reslen }; vec::slice(res, 0u, reslen as uint).to_owned() res.slice(0u, reslen as uint).to_owned() } } } Loading Loading
hash.rs +3 −4 Original line number Diff line number Diff line Loading @@ -109,7 +109,6 @@ mod tests { use super::*; use hex::FromHex; use hex::ToHex; use std::vec; struct HashTest { input: ~[u8], Loading Loading @@ -152,7 +151,7 @@ mod tests { HashTest(~"A510CD18F7A56852EB0319", ~"577E216843DD11573574D3FB209B97D8"), HashTest(~"AAED18DBE8938C19ED734A8D", ~"6F80FB775F27E0A4CE5C2F42FC72C5F1")]; for vec::each(tests) |test| { for tests.iter().advance |test| { hash_test(MD5, test); } } Loading @@ -164,7 +163,7 @@ mod tests { HashTest(~"616263", ~"A9993E364706816ABA3E25717850C26C9CD0D89D"), ]; for vec::each(tests) |test| { for tests.iter().advance |test| { hash_test(SHA1, test); } } Loading @@ -175,7 +174,7 @@ mod tests { HashTest(~"616263", ~"BA7816BF8F01CFEA414140DE5DAE2223B00361A396177A9CB410FF61F20015AD") ]; for vec::each(tests) |test| { for tests.iter().advance |test| { hash_test(SHA256, test); } } Loading
hex.rs +1 −1 Original line number Diff line number Diff line Loading @@ -58,7 +58,7 @@ impl<'self> FromHex for &'self str { else { fail!(~"bad hex character"); }; if i % 2 == 0 { vec::push(&mut vec, nibble << 4); vec.push(nibble << 4); } else { vec[i/2] |= nibble; Loading
pkey.rs +4 −4 Original line number Diff line number Diff line Loading @@ -110,7 +110,7 @@ impl PKey { f(self.evp, &ps) }; vec::slice(s, 0u, r as uint).to_owned() s.slice(0u, r as uint).to_owned() } priv unsafe fn _fromstr( Loading Loading @@ -256,7 +256,7 @@ impl PKey { if rv < 0 as c_int { ~[] } else { vec::slice(r, 0u, rv as uint).to_owned() r.slice(0u, rv as uint).to_owned() } } } Loading Loading @@ -285,7 +285,7 @@ impl PKey { if rv < 0 as c_int { ~[] } else { vec::slice(r, 0u, rv as uint).to_owned() r.slice(0u, rv as uint).to_owned() } } } Loading Loading @@ -334,7 +334,7 @@ impl PKey { if rv < 0 as c_int { ~[] } else { vec::slice(r, 0u, len as uint).to_owned() r.slice(0u, len as uint).to_owned() } } } Loading
symm.rs +2 −2 Original line number Diff line number Diff line Loading @@ -148,7 +148,7 @@ impl Crypter { reslen }; vec::slice(res, 0u, reslen as uint).to_owned() res.slice(0u, reslen as uint).to_owned() } } } Loading @@ -166,7 +166,7 @@ impl Crypter { reslen }; vec::slice(res, 0u, reslen as uint).to_owned() res.slice(0u, reslen as uint).to_owned() } } } Loading