Skip to content

Commit c310341

Browse files
committed
crypto: hmac - Add ahash support
Add ahash support to hmac so that drivers that can't do hmac in hardware do not have to implement duplicate copies of hmac. Signed-off-by: Herbert Xu <[email protected]>
1 parent 8e69871 commit c310341

File tree

4 files changed

+345
-15
lines changed

4 files changed

+345
-15
lines changed

crypto/ahash.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ int crypto_has_ahash(const char *alg_name, u32 type, u32 mask)
846846
}
847847
EXPORT_SYMBOL_GPL(crypto_has_ahash);
848848

849-
static bool crypto_hash_alg_has_setkey(struct hash_alg_common *halg)
849+
bool crypto_hash_alg_has_setkey(struct hash_alg_common *halg)
850850
{
851851
struct crypto_alg *alg = &halg->base;
852852

@@ -855,6 +855,7 @@ static bool crypto_hash_alg_has_setkey(struct hash_alg_common *halg)
855855

856856
return __crypto_ahash_alg(alg)->setkey != ahash_nosetkey;
857857
}
858+
EXPORT_SYMBOL_GPL(crypto_hash_alg_has_setkey);
858859

859860
struct crypto_ahash *crypto_clone_ahash(struct crypto_ahash *hash)
860861
{
@@ -1077,5 +1078,12 @@ int crypto_hash_digest(struct crypto_ahash *tfm, const u8 *data,
10771078
}
10781079
EXPORT_SYMBOL_GPL(crypto_hash_digest);
10791080

1081+
void ahash_free_singlespawn_instance(struct ahash_instance *inst)
1082+
{
1083+
crypto_drop_spawn(ahash_instance_ctx(inst));
1084+
kfree(inst);
1085+
}
1086+
EXPORT_SYMBOL_GPL(ahash_free_singlespawn_instance);
1087+
10801088
MODULE_LICENSE("GPL");
10811089
MODULE_DESCRIPTION("Asynchronous cryptographic hash type");

0 commit comments

Comments
 (0)