[PATCH v3 01/16] crypto: sha1: implement base layer for SHA-1

Herbert Xu herbert at gondor.apana.org.au
Wed Apr 8 06:19:16 PDT 2015


On Tue, Apr 07, 2015 at 10:51:49AM +0200, Ard Biesheuvel wrote:
>
> +typedef void (sha1_block_fn)(int blocks, u8 const *src, u32 *state,
> +			     const u8 *head, void *p);

Does this really need five arguments? First of all we can get rid
of head by just calling this function twice.  The last argument
appears to only be used by arm64 where it is simply another way
of saying (sctx->count + len) % SHA_BLOCK_SIZE != 0.  So why not
get rid of it and just use the conditional?

Cheers,
-- 
Email: Herbert Xu <herbert at gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt



More information about the linux-arm-kernel mailing list