• Nicolas Pitre's avatar
    [CRYPTO] sha1: Avoid useless memcpy() · cfa8d17c
    Nicolas Pitre authored
    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: default avatarNicolas Pitre <nico@cam.org>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    cfa8d17c
sha1.c 2.93 KB