diff options
| author | Herbert Xu <herbert@gondor.apana.org.au> | 2009-07-08 01:56:28 -0800 |
|---|---|---|
| committer | Herbert Xu <herbert@gondor.apana.org.au> | 2009-07-08 02:58:30 -0800 |
| commit | 7d6f56400a695af497a8b7c23ea0ff9c3d9d99f4 (patch) | |
| tree | 53447ff76fda984ca3fb59aca2bd5f3454842b14 /crypto/shash.c | |
| parent | d06854f0243d91badabaab14503f7f3bb770061d (diff) | |
| download | linux-stable-7d6f56400a695af497a8b7c23ea0ff9c3d9d99f4.tar.gz linux-stable-7d6f56400a695af497a8b7c23ea0ff9c3d9d99f4.tar.bz2 linux-stable-7d6f56400a695af497a8b7c23ea0ff9c3d9d99f4.tar.xz linux-stable-7d6f56400a695af497a8b7c23ea0ff9c3d9d99f4.zip | |
crypto: shash - Add shash_attr_alg2 helper
This patch adds the helper shash_attr_alg2 which locates a shash
algorithm based on the information in the given attribute.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/shash.c')
| -rw-r--r-- | crypto/shash.c | 10 |
1 files changed, 10 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"); |
