diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2009-07-12 01:58:04 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2009-07-14 00:58:07 -0400 |
commit | 6941c3a0aabb6ad4167827360f384e9daed7dd7f (patch) | |
tree | 679c89fd67dc35bd4d2279481c830ef29f2a5db6 | |
parent | 9ef074fa9b525f7fc7a35d0761f3d4ed01fe8252 (diff) |
crypto: hash - Remove legacy hash/digest implementaion
This patch removes the implementation of hash and digest now that
no algorithms use them anymore. The interface though will remain
until the users are converted across.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r-- | crypto/Makefile | 3 | ||||
-rw-r--r-- | crypto/api.c | 19 | ||||
-rw-r--r-- | crypto/internal.h | 15 |
3 files changed, 3 insertions, 34 deletions
diff --git a/crypto/Makefile b/crypto/Makefile index 673d9f7c1bda..3c961b4d8046 100644 --- a/crypto/Makefile +++ b/crypto/Makefile | |||
@@ -3,7 +3,7 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | obj-$(CONFIG_CRYPTO) += crypto.o | 5 | obj-$(CONFIG_CRYPTO) += crypto.o |
6 | crypto-objs := api.o cipher.o digest.o compress.o | 6 | crypto-objs := api.o cipher.o compress.o |
7 | 7 | ||
8 | obj-$(CONFIG_CRYPTO_WORKQUEUE) += crypto_wq.o | 8 | obj-$(CONFIG_CRYPTO_WORKQUEUE) += crypto_wq.o |
9 | 9 | ||
@@ -22,7 +22,6 @@ obj-$(CONFIG_CRYPTO_BLKCIPHER2) += chainiv.o | |||
22 | obj-$(CONFIG_CRYPTO_BLKCIPHER2) += eseqiv.o | 22 | obj-$(CONFIG_CRYPTO_BLKCIPHER2) += eseqiv.o |
23 | obj-$(CONFIG_CRYPTO_SEQIV) += seqiv.o | 23 | obj-$(CONFIG_CRYPTO_SEQIV) += seqiv.o |
24 | 24 | ||
25 | crypto_hash-objs := hash.o | ||
26 | crypto_hash-objs += ahash.o | 25 | crypto_hash-objs += ahash.o |
27 | crypto_hash-objs += shash.o | 26 | crypto_hash-objs += shash.o |
28 | obj-$(CONFIG_CRYPTO_HASH2) += crypto_hash.o | 27 | obj-$(CONFIG_CRYPTO_HASH2) += crypto_hash.o |
diff --git a/crypto/api.c b/crypto/api.c index ba81221b3bef..c8ac18f7ac1e 100644 --- a/crypto/api.c +++ b/crypto/api.c | |||
@@ -285,13 +285,6 @@ static int crypto_init_ops(struct crypto_tfm *tfm, u32 type, u32 mask) | |||
285 | switch (crypto_tfm_alg_type(tfm)) { | 285 | switch (crypto_tfm_alg_type(tfm)) { |
286 | case CRYPTO_ALG_TYPE_CIPHER: | 286 | case CRYPTO_ALG_TYPE_CIPHER: |
287 | return crypto_init_cipher_ops(tfm); | 287 | return crypto_init_cipher_ops(tfm); |
288 | |||
289 | case CRYPTO_ALG_TYPE_DIGEST: | ||
290 | if ((mask & CRYPTO_ALG_TYPE_HASH_MASK) != | ||
291 | CRYPTO_ALG_TYPE_HASH_MASK) | ||
292 | return crypto_init_digest_ops_async(tfm); | ||
293 | else | ||
294 | return crypto_init_digest_ops(tfm); | ||
295 | 288 | ||
296 | case CRYPTO_ALG_TYPE_COMPRESS: | 289 | case CRYPTO_ALG_TYPE_COMPRESS: |
297 | return crypto_init_compress_ops(tfm); | 290 | return crypto_init_compress_ops(tfm); |
@@ -318,11 +311,7 @@ static void crypto_exit_ops(struct crypto_tfm *tfm) | |||
318 | case CRYPTO_ALG_TYPE_CIPHER: | 311 | case CRYPTO_ALG_TYPE_CIPHER: |
319 | crypto_exit_cipher_ops(tfm); | 312 | crypto_exit_cipher_ops(tfm); |
320 | break; | 313 | break; |
321 | 314 | ||
322 | case CRYPTO_ALG_TYPE_DIGEST: | ||
323 | crypto_exit_digest_ops(tfm); | ||
324 | break; | ||
325 | |||
326 | case CRYPTO_ALG_TYPE_COMPRESS: | 315 | case CRYPTO_ALG_TYPE_COMPRESS: |
327 | crypto_exit_compress_ops(tfm); | 316 | crypto_exit_compress_ops(tfm); |
328 | break; | 317 | break; |
@@ -349,11 +338,7 @@ static unsigned int crypto_ctxsize(struct crypto_alg *alg, u32 type, u32 mask) | |||
349 | case CRYPTO_ALG_TYPE_CIPHER: | 338 | case CRYPTO_ALG_TYPE_CIPHER: |
350 | len += crypto_cipher_ctxsize(alg); | 339 | len += crypto_cipher_ctxsize(alg); |
351 | break; | 340 | break; |
352 | 341 | ||
353 | case CRYPTO_ALG_TYPE_DIGEST: | ||
354 | len += crypto_digest_ctxsize(alg); | ||
355 | break; | ||
356 | |||
357 | case CRYPTO_ALG_TYPE_COMPRESS: | 342 | case CRYPTO_ALG_TYPE_COMPRESS: |
358 | len += crypto_compress_ctxsize(alg); | 343 | len += crypto_compress_ctxsize(alg); |
359 | break; | 344 | break; |
diff --git a/crypto/internal.h b/crypto/internal.h index 7efa4d0533ff..030e22921c30 100644 --- a/crypto/internal.h +++ b/crypto/internal.h | |||
@@ -60,18 +60,6 @@ static inline void crypto_exit_proc(void) | |||
60 | { } | 60 | { } |
61 | #endif | 61 | #endif |
62 | 62 | ||
63 | static inline unsigned int crypto_digest_ctxsize(struct crypto_alg *alg) | ||
64 | { | ||
65 | unsigned int len = alg->cra_ctxsize; | ||
66 | |||
67 | if (alg->cra_alignmask) { | ||
68 | len = ALIGN(len, (unsigned long)alg->cra_alignmask + 1); | ||
69 | len += alg->cra_digest.dia_digestsize; | ||
70 | } | ||
71 | |||
72 | return len; | ||
73 | } | ||
74 | |||
75 | static inline unsigned int crypto_cipher_ctxsize(struct crypto_alg *alg) | 63 | static inline unsigned int crypto_cipher_ctxsize(struct crypto_alg *alg) |
76 | { | 64 | { |
77 | return alg->cra_ctxsize; | 65 | return alg->cra_ctxsize; |
@@ -86,12 +74,9 @@ struct crypto_alg *crypto_mod_get(struct crypto_alg *alg); | |||
86 | struct crypto_alg *crypto_alg_lookup(const char *name, u32 type, u32 mask); | 74 | struct crypto_alg *crypto_alg_lookup(const char *name, u32 type, u32 mask); |
87 | struct crypto_alg *crypto_alg_mod_lookup(const char *name, u32 type, u32 mask); | 75 | struct crypto_alg *crypto_alg_mod_lookup(const char *name, u32 type, u32 mask); |
88 | 76 | ||
89 | int crypto_init_digest_ops(struct crypto_tfm *tfm); | ||
90 | int crypto_init_digest_ops_async(struct crypto_tfm *tfm); | ||
91 | int crypto_init_cipher_ops(struct crypto_tfm *tfm); | 77 | int crypto_init_cipher_ops(struct crypto_tfm *tfm); |
92 | int crypto_init_compress_ops(struct crypto_tfm *tfm); | 78 | int crypto_init_compress_ops(struct crypto_tfm *tfm); |
93 | 79 | ||
94 | void crypto_exit_digest_ops(struct crypto_tfm *tfm); | ||
95 | void crypto_exit_cipher_ops(struct crypto_tfm *tfm); | 80 | void crypto_exit_cipher_ops(struct crypto_tfm *tfm); |
96 | void crypto_exit_compress_ops(struct crypto_tfm *tfm); | 81 | void crypto_exit_compress_ops(struct crypto_tfm *tfm); |
97 | 82 | ||