crypto: hash - add support for new way of freeing instances
Add support to shash and ahash for the new way of freeing instances (already used for skcipher, aead, and akcipher) where a ->free() method is installed to the instance struct itself. These methods are more strongly-typed than crypto_template::free(), which they replace. This will allow removing support for the old way of freeing instances. Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
@@ -30,6 +30,7 @@ struct crypto_hash_walk {
|
||||
};
|
||||
|
||||
struct ahash_instance {
|
||||
void (*free)(struct ahash_instance *inst);
|
||||
union {
|
||||
struct {
|
||||
char head[offsetof(struct ahash_alg, halg.base)];
|
||||
@@ -40,6 +41,7 @@ struct ahash_instance {
|
||||
};
|
||||
|
||||
struct shash_instance {
|
||||
void (*free)(struct shash_instance *inst);
|
||||
union {
|
||||
struct {
|
||||
char head[offsetof(struct shash_alg, base)];
|
||||
|
Reference in New Issue
Block a user