diff options
-rw-r--r-- | crypto/shash.c | 10 | ||||
-rw-r--r-- | include/crypto/internal/hash.h | 2 |
2 files changed, 12 insertions, 0 deletions
diff --git a/crypto/shash.c b/crypto/shash.c index 97f6c8ba103a..21bcff6be5b0 100644 --- a/crypto/shash.c +++ b/crypto/shash.c | |||
@@ -518,5 +518,15 @@ int crypto_init_shash_spawn(struct crypto_shash_spawn *spawn, | |||
518 | } | 518 | } |
519 | EXPORT_SYMBOL_GPL(crypto_init_shash_spawn); | 519 | EXPORT_SYMBOL_GPL(crypto_init_shash_spawn); |
520 | 520 | ||
521 | struct shash_alg *shash_attr_alg(struct rtattr *rta, u32 type, u32 mask) | ||
522 | { | ||
523 | struct crypto_alg *alg; | ||
524 | |||
525 | alg = crypto_attr_alg2(rta, &crypto_shash_type, type, mask); | ||
526 | return IS_ERR(alg) ? ERR_CAST(alg) : | ||
527 | container_of(alg, struct shash_alg, base); | ||
528 | } | ||
529 | EXPORT_SYMBOL_GPL(shash_attr_alg); | ||
530 | |||
521 | MODULE_LICENSE("GPL"); | 531 | MODULE_LICENSE("GPL"); |
522 | MODULE_DESCRIPTION("Synchronous cryptographic hash type"); | 532 | MODULE_DESCRIPTION("Synchronous cryptographic hash type"); |
diff --git a/include/crypto/internal/hash.h b/include/crypto/internal/hash.h index 6cc824b79331..e2ab35a74c62 100644 --- a/include/crypto/internal/hash.h +++ b/include/crypto/internal/hash.h | |||
@@ -60,6 +60,8 @@ int crypto_init_shash_spawn(struct crypto_shash_spawn *spawn, | |||
60 | struct shash_alg *alg, | 60 | struct shash_alg *alg, |
61 | struct crypto_instance *inst); | 61 | struct crypto_instance *inst); |
62 | 62 | ||
63 | struct shash_alg *shash_attr_alg(struct rtattr *rta, u32 type, u32 mask); | ||
64 | |||
63 | static inline void *crypto_ahash_ctx(struct crypto_ahash *tfm) | 65 | static inline void *crypto_ahash_ctx(struct crypto_ahash *tfm) |
64 | { | 66 | { |
65 | return crypto_tfm_ctx(&tfm->base); | 67 | return crypto_tfm_ctx(&tfm->base); |