]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - crypto/sha1.c
[CRYPTO] sha1: Fixed off-by-64 bug in sha1_update
[linux-2.6-omap-h63xx.git] / crypto / sha1.c
index 8048e2dd3c14e3343a7efc78985e787c70466bca..21571ed35b7ee7f90792a5f8b83ea2b42ff6cac6 100644 (file)
@@ -61,8 +61,8 @@ static void sha1_update(void *ctx, const u8 *data, unsigned int len)
                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;
                }