[CRYPTO] sha1: Avoid useless memcpy()
authorNicolas Pitre <nico@cam.org>
Sat, 12 Nov 2005 23:47:20 +0000 (10:47 +1100)
committerDavid S. Miller <davem@sunset.davemloft.net>
Mon, 9 Jan 2006 22:15:41 +0000 (14:15 -0800)
commitcfa8d17cc836905ad174fd924701b352585d62f1
tree6c966440661a678aea2082cf72c1bee0886a0a57
parentc8a19c91b5b488fed8cce04200a84c6a35c0bf0c
[CRYPTO] sha1: Avoid useless memcpy()

The current code unconditionally copy the first block for every call to
sha1_update().  This can be avoided if there is no pending partial block.
This is always the case on the first call to sha1_update() (if the length
is >= 64 of course.

Furthermore, temp does need to be called if sha_transform is never invoked.
Also consolidate the sha_transform calls into one to reduce code size.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/sha1.c