diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2018-05-17 03:14:09 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2018-05-17 07:24:39 -0400 |
commit | 62e4df2a38081f62fd1bd657459b7ffb2d4f522c (patch) | |
tree | 9b4ed5d3c597e19894ca77299b53057efe071c50 /include/crypto/hash.h | |
parent | 426e88e41cdcecd007a689daf4fe432bb61303ec (diff) |
drop dead code
Diffstat (limited to 'include/crypto/hash.h')
-rw-r--r-- | include/crypto/hash.h | 44 |
1 files changed, 16 insertions, 28 deletions
diff --git a/include/crypto/hash.h b/include/crypto/hash.h index 97edaa88..a74f3618 100644 --- a/include/crypto/hash.h +++ b/include/crypto/hash.h @@ -14,19 +14,8 @@ #define _CRYPTO_HASH_H #include <linux/crypto.h> -#include <linux/string.h> -struct shash_desc { - struct crypto_shash *tfm; - u32 flags; - - void *__ctx[] CRYPTO_MINALIGN_ATTR; -}; - -#define SHASH_DESC_ON_STACK(shash, ctx) \ - char __##shash##_desc[sizeof(struct shash_desc) + \ - crypto_shash_descsize(ctx)] CRYPTO_MINALIGN_ATTR; \ - struct shash_desc *shash = (struct shash_desc *)__##shash##_desc +struct shash_desc; struct shash_alg { int (*init)(struct shash_desc *desc); @@ -42,6 +31,8 @@ struct shash_alg { struct crypto_alg base; }; +int crypto_register_shash(struct shash_alg *alg); + struct crypto_shash { unsigned descsize; struct crypto_tfm base; @@ -50,24 +41,14 @@ struct crypto_shash { struct crypto_shash *crypto_alloc_shash(const char *alg_name, u32 type, u32 mask); -static inline struct crypto_tfm *crypto_shash_tfm(struct crypto_shash *tfm) -{ - return &tfm->base; -} - static inline void crypto_free_shash(struct crypto_shash *tfm) { - crypto_destroy_tfm(tfm, crypto_shash_tfm(tfm)); -} - -static inline struct shash_alg *__crypto_shash_alg(struct crypto_alg *alg) -{ - return container_of(alg, struct shash_alg, base); + kfree(tfm); } static inline struct shash_alg *crypto_shash_alg(struct crypto_shash *tfm) { - return __crypto_shash_alg(crypto_shash_tfm(tfm)->__crt_alg); + return container_of(tfm->base.alg, struct shash_alg, base); } static inline unsigned crypto_shash_digestsize(struct crypto_shash *tfm) @@ -80,10 +61,17 @@ static inline unsigned crypto_shash_descsize(struct crypto_shash *tfm) return tfm->descsize; } -static inline void *shash_desc_ctx(struct shash_desc *desc) -{ - return desc->__ctx; -} +struct shash_desc { + struct crypto_shash *tfm; + u32 flags; + + void *ctx[] CRYPTO_MINALIGN_ATTR; +}; + +#define SHASH_DESC_ON_STACK(shash, tfm) \ + char __##shash##_desc[sizeof(struct shash_desc) + \ + crypto_shash_descsize(tfm)] CRYPTO_MINALIGN_ATTR; \ + struct shash_desc *shash = (struct shash_desc *)__##shash##_desc static inline int crypto_shash_init(struct shash_desc *desc) { |