From cf1c5040b89f78a7f5465521e4dbdde91368f184 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Wed, 13 May 2015 16:16:29 -0400 Subject: simplify --- src/sha1.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sha1.rs b/src/sha1.rs index bcd9295..f381352 100644 --- a/src/sha1.rs +++ b/src/sha1.rs @@ -92,8 +92,8 @@ pub fn sha1_with_state (bytes: &[u8], mut h: [u32; 5]) -> [u8; 20] { pub fn sha1_mac (bytes: &[u8], key: &[u8]) -> [u8; 20] { let full_bytes: Vec = key .iter() + .chain(bytes.iter()) .map(|x| *x) - .chain(bytes.iter().map(|x| *x)) .collect(); return sha1(&full_bytes[..]); } -- cgit v1.2.3-54-g00ecf