aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/crypto.h
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2009-07-14 00:28:26 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2009-07-14 03:54:07 -0400
commit88056ec346ccf41f63dbc7080b24b5fd19d1358d (patch)
treeb78a82cbce49183e587ab8a1a5a5922611468361 /include/linux/crypto.h
parent2ca33da1dea3ba53d1425226a6bac073c5e8568c (diff)
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/linux/crypto.h')
-rw-r--r--include/linux/crypto.h29
1 files changed, 3 insertions, 26 deletions
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index 274f9c7da90c..9e7e9b62a3dc 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -120,6 +120,7 @@ struct crypto_rng;
120struct crypto_tfm; 120struct crypto_tfm;
121struct crypto_type; 121struct crypto_type;
122struct aead_givcrypt_request; 122struct aead_givcrypt_request;
123struct ahash_request;
123struct skcipher_givcrypt_request; 124struct skcipher_givcrypt_request;
124 125
125typedef void (*crypto_completion_t)(struct crypto_async_request *req, int err); 126typedef void (*crypto_completion_t)(struct crypto_async_request *req, int err);
@@ -146,16 +147,6 @@ struct ablkcipher_request {
146 void *__ctx[] CRYPTO_MINALIGN_ATTR; 147 void *__ctx[] CRYPTO_MINALIGN_ATTR;
147}; 148};
148 149
149struct ahash_request {
150 struct crypto_async_request base;
151
152 unsigned int nbytes;
153 struct scatterlist *src;
154 u8 *result;
155
156 void *__ctx[] CRYPTO_MINALIGN_ATTR;
157};
158
159/** 150/**
160 * struct aead_request - AEAD request 151 * struct aead_request - AEAD request
161 * @base: Common attributes for async crypto requests 152 * @base: Common attributes for async crypto requests
@@ -220,7 +211,7 @@ struct ablkcipher_alg {
220 unsigned int ivsize; 211 unsigned int ivsize;
221}; 212};
222 213
223struct ahash_alg { 214struct old_ahash_alg {
224 int (*init)(struct ahash_request *req); 215 int (*init)(struct ahash_request *req);
225 int (*reinit)(struct ahash_request *req); 216 int (*reinit)(struct ahash_request *req);
226 int (*update)(struct ahash_request *req); 217 int (*update)(struct ahash_request *req);
@@ -346,7 +337,7 @@ struct crypto_alg {
346 struct cipher_alg cipher; 337 struct cipher_alg cipher;
347 struct digest_alg digest; 338 struct digest_alg digest;
348 struct hash_alg hash; 339 struct hash_alg hash;
349 struct ahash_alg ahash; 340 struct old_ahash_alg ahash;
350 struct compress_alg compress; 341 struct compress_alg compress;
351 struct rng_alg rng; 342 struct rng_alg rng;
352 } cra_u; 343 } cra_u;
@@ -433,18 +424,6 @@ struct hash_tfm {
433 unsigned int digestsize; 424 unsigned int digestsize;
434}; 425};
435 426
436struct ahash_tfm {
437 int (*init)(struct ahash_request *req);
438 int (*update)(struct ahash_request *req);
439 int (*final)(struct ahash_request *req);
440 int (*digest)(struct ahash_request *req);
441 int (*setkey)(struct crypto_ahash *tfm, const u8 *key,
442 unsigned int keylen);
443
444 unsigned int digestsize;
445 unsigned int reqsize;
446};
447
448struct compress_tfm { 427struct compress_tfm {
449 int (*cot_compress)(struct crypto_tfm *tfm, 428 int (*cot_compress)(struct crypto_tfm *tfm,
450 const u8 *src, unsigned int slen, 429 const u8 *src, unsigned int slen,
@@ -465,7 +444,6 @@ struct rng_tfm {
465#define crt_blkcipher crt_u.blkcipher 444#define crt_blkcipher crt_u.blkcipher
466#define crt_cipher crt_u.cipher 445#define crt_cipher crt_u.cipher
467#define crt_hash crt_u.hash 446#define crt_hash crt_u.hash
468#define crt_ahash crt_u.ahash
469#define crt_compress crt_u.compress 447#define crt_compress crt_u.compress
470#define crt_rng crt_u.rng 448#define crt_rng crt_u.rng
471 449
@@ -479,7 +457,6 @@ struct crypto_tfm {
479 struct blkcipher_tfm blkcipher; 457 struct blkcipher_tfm blkcipher;
480 struct cipher_tfm cipher; 458 struct cipher_tfm cipher;
481 struct hash_tfm hash; 459 struct hash_tfm hash;
482 struct ahash_tfm ahash;
483 struct compress_tfm compress; 460 struct compress_tfm compress;
484 struct rng_tfm rng; 461 struct rng_tfm rng;
485 } crt_u; 462 } crt_u;