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

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


On Wed, Apr 08, 2015 at 03:25:14PM +0200, Ard Biesheuvel wrote:
>
> Not having to call the function twice is the whole point. In the arm64
> case, all the SHA-256 round keys can be kept in registers (it has 32
> 16-byte SIMD registers), and that is what motivates this pattern. By
> passing a head block, a pointer to the source and the generic pointer
> (which arm64 uses to finalize the block, we can process all data in a
> single invocation of the block transform)

Does this really make any difference? With IPsec the partial code
path is never even going to get executed.

> Do note that these are only used by static inline functions, so the
> unused arguments are all eliminated from the binary anyway. In fact,
> looking at the generated code, the function calls don't use function
> pointers at all anymore,
> but just call the block transform directly, so the typedef is only
> used as a prototype, really.

It's not just the generated code.  The next guy that comes along
and writes a SHA implementation is going to go WTH is this p
argument.  I'm not going to add crap to the generic layer just
because ARM needs it.  In fact ARM doesn't even need it.

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