summaryrefslogtreecommitdiffstats
path: root/include/linux/cryptohash.h
diff options
context:
space:
mode:
authorMandeep Singh Baines2011-08-06 03:46:27 +0200
committerLinus Torvalds2011-08-06 20:26:52 +0200
commit1eb19a12bd2214cdcad5273d472b062a4ba97fa1 (patch)
treea88b76f31a4ea5e3631581be249759fcf4b05a08 /include/linux/cryptohash.h
parentMerge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/air... (diff)
downloadkernel-qcow2-linux-1eb19a12bd2214cdcad5273d472b062a4ba97fa1.tar.gz
kernel-qcow2-linux-1eb19a12bd2214cdcad5273d472b062a4ba97fa1.tar.xz
kernel-qcow2-linux-1eb19a12bd2214cdcad5273d472b062a4ba97fa1.zip
lib/sha1: use the git implementation of SHA-1
For ChromiumOS, we use SHA-1 to verify the integrity of the root filesystem. The speed of the kernel sha-1 implementation has a major impact on our boot performance. To improve boot performance, we investigated using the heavily optimized sha-1 implementation used in git. With the git sha-1 implementation, we see a 11.7% improvement in boot time. 10 reboots, remove slowest/fastest. Before: Mean: 6.58 seconds Stdev: 0.14 After (with git sha-1, this patch): Mean: 5.89 seconds Stdev: 0.07 The other cool thing about the git SHA-1 implementation is that it only needs 64 bytes of stack for the workspace while the original kernel implementation needed 320 bytes. Signed-off-by: Mandeep Singh Baines <msb@chromium.org> Cc: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Cc: Nicolas Pitre <nico@cam.org> Cc: Herbert Xu <herbert@gondor.apana.org.au> Cc: David S. Miller <davem@davemloft.net> Cc: linux-crypto@vger.kernel.org Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/cryptohash.h')
-rw-r--r--include/linux/cryptohash.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/cryptohash.h b/include/linux/cryptohash.h
index ec78a4bbe1d5..f9452185b019 100644
--- a/include/linux/cryptohash.h
+++ b/include/linux/cryptohash.h
@@ -3,7 +3,7 @@
#define SHA_DIGEST_WORDS 5
#define SHA_MESSAGE_BYTES (512 /*bits*/ / 8)
-#define SHA_WORKSPACE_WORDS 80
+#define SHA_WORKSPACE_WORDS 16
void sha_init(__u32 *buf);
void sha_transform(__u32 *digest, const char *data, __u32 *W);