summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/sha1.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sha1.rs b/src/sha1.rs
index f381352..e2c86b1 100644
--- a/src/sha1.rs
+++ b/src/sha1.rs
@@ -29,7 +29,7 @@ pub fn sha1_padding (len: u64) -> Vec<u8> {
return [0x80u8]
.iter()
.map(|x| *x)
- .chain(::std::iter::repeat(0x00).take(55 - (len % 64) as usize))
+ .chain(::std::iter::repeat(0x00).take((119 - (len % 64) as usize) % 64))
.chain(ml_bytes.iter().map(|x| *x))
.collect();
}