mitsuhiko/sha1-smol

Digest is wrong for text sizes 55 + 64n

glandium opened this issue · 3 comments

The two following tests demonstrate the problem:

diff --git a/src/lib.rs b/src/lib.rs
index 4eec38b..403e84e 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -187,6 +187,10 @@ fn test_simple() {
         ("testing\n", "9801739daae44ec5293d4e1f53d3f4d2d426d91c"),
         ("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
          "025ecbd5d70f8fb3c5457cd96bab13fda305dc59"),
+        ("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
+         "4300320394f7ee239bcdce7d3b8bcee173a0cd5c"),
+        ("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
+         "cef734ba81a024479e09eb5a75b6ddae62e6abf1"),
     ];

     for &(s, ref h) in tests.iter() {

Cannot reproduce but alexcrichton might have fixed that in #13.

Run a quick test, broken before #13, fixed with #13

Perfect. Closing this then.