[CRYPTO] sha1: Fixed off-by-64 bug in sha1_update
After a partial update, the done pointer is off to the right by 64 bytes.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
diff --git a/crypto/sha1.c b/crypto/sha1.c
index 8048e2d..21571ed3 100644
--- a/crypto/sha1.c
+++ b/crypto/sha1.c
@@ -61,8 +61,8 @@
u32 temp[SHA_WORKSPACE_WORDS];
if (partial) {
- done = 64 - partial;
- memcpy(sctx->buffer + partial, data, done);
+ done = -partial;
+ memcpy(sctx->buffer + partial, data, done + 64);
src = sctx->buffer;
}