crypto: shash - eliminate indirect call for default import and export
authorEric Biggers <ebiggers@google.com>
Wed, 18 Oct 2023 22:34:55 +0000 (15:34 -0700)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 27 Oct 2023 10:04:24 +0000 (18:04 +0800)
commit08debaa5cb31da50725a8cb2f06d3f617a9caa98
tree29f3f1b9b6282469e3dda1441ce9e4d8bc16564e
parenta411f6debeb33e2ec8f5825f0c41497317c0504e
crypto: shash - eliminate indirect call for default import and export

Most shash algorithms don't have custom ->import and ->export functions,
resulting in the memcpy() based default being used.  Yet,
crypto_shash_import() and crypto_shash_export() still make an indirect
call, which is expensive.  Therefore, change how the default import and
export are called to make it so that crypto_shash_import() and
crypto_shash_export() don't do an indirect call in this case.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/shash.c
include/crypto/hash.h