]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: shash - make struct shash_instance be the full size
authorEric Biggers <ebiggers@google.com>
Fri, 3 Jan 2020 03:58:43 +0000 (19:58 -0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 9 Jan 2020 03:30:54 +0000 (11:30 +0800)
commit3b928dd77ef213949e6def5d93a13c499974f736
treef5f7cc27294a3a0f159231823535f70f4a5a7f85
parentc2be9c06748b187b76a3146c461d7730dac12854
crypto: shash - make struct shash_instance be the full size

Define struct shash_instance in a way analogous to struct
skcipher_instance, struct aead_instance, and struct akcipher_instance,
where the struct is defined to include both the algorithm structure at
the beginning and the additional crypto_instance fields at the end.

This is needed to allow allocating shash instances directly using
kzalloc(sizeof(*inst) + sizeof(*ictx), ...) in the same way as skcipher,
aead, and akcipher instances.  In turn, that's needed to make spawns be
initialized in a consistent way everywhere.

Also take advantage of the addition of the base instance to struct
shash_instance by simplifying the shash_crypto_instance() and
shash_instance() functions.

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