summaryrefslogtreecommitdiff
path: root/include/crypto/internal
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2009-07-14 12:28:26 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2009-07-14 15:54:07 +0800
commit88056ec346ccf41f63dbc7080b24b5fd19d1358d (patch)
treeb78a82cbce49183e587ab8a1a5a5922611468361 /include/crypto/internal
parent2ca33da1dea3ba53d1425226a6bac073c5e8568c (diff)
downloadlinux-3.10-88056ec346ccf41f63dbc7080b24b5fd19d1358d.tar.gz
linux-3.10-88056ec346ccf41f63dbc7080b24b5fd19d1358d.tar.bz2
linux-3.10-88056ec346ccf41f63dbc7080b24b5fd19d1358d.zip
crypto: ahash - Convert to new style algorithms
This patch converts crypto_ahash to the new style. The old ahash algorithm type is retained until the existing ahash implementations are also converted. All ahash users will automatically get the new crypto_ahash type. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/crypto/internal')
-rw-r--r--include/crypto/internal/hash.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/include/crypto/internal/hash.h b/include/crypto/internal/hash.h
index 5e45818f335..08bdffafefa 100644
--- a/include/crypto/internal/hash.h
+++ b/include/crypto/internal/hash.h
@@ -51,6 +51,9 @@ int crypto_hash_walk_first_compat(struct hash_desc *hdesc,
struct crypto_hash_walk *walk,
struct scatterlist *sg, unsigned int len);
+int crypto_register_ahash(struct ahash_alg *alg);
+int crypto_unregister_ahash(struct ahash_alg *alg);
+
int crypto_register_shash(struct shash_alg *alg);
int crypto_unregister_shash(struct shash_alg *alg);
int shash_register_instance(struct crypto_template *tmpl,
@@ -66,12 +69,14 @@ struct shash_alg *shash_attr_alg(struct rtattr *rta, u32 type, u32 mask);
int shash_ahash_update(struct ahash_request *req, struct shash_desc *desc);
int shash_ahash_digest(struct ahash_request *req, struct shash_desc *desc);
+int crypto_init_shash_ops_async(struct crypto_tfm *tfm);
+
static inline void *crypto_ahash_ctx(struct crypto_ahash *tfm)
{
- return crypto_tfm_ctx(&tfm->base);
+ return crypto_tfm_ctx(crypto_ahash_tfm(tfm));
}
-static inline struct ahash_alg *crypto_ahash_alg(
+static inline struct old_ahash_alg *crypto_old_ahash_alg(
struct crypto_ahash *tfm)
{
return &crypto_ahash_tfm(tfm)->__crt_alg->cra_ahash;
@@ -80,7 +85,7 @@ static inline struct ahash_alg *crypto_ahash_alg(
static inline void crypto_ahash_set_reqsize(struct crypto_ahash *tfm,
unsigned int reqsize)
{
- crypto_ahash_crt(tfm)->reqsize = reqsize;
+ tfm->reqsize = reqsize;
}
static inline int ahash_enqueue_request(struct crypto_queue *queue,