aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2007-12-10 03:18:01 -0500
committerHerbert Xu <herbert@gondor.apana.org.au>2008-01-10 16:16:49 -0500
commit743edf57272fd420348e148bf94f9e48ed6abb70 (patch)
treebe4a96ae7f7f8a6b42bf01cc7a61cb4b5938ab50 /include/linux
parent03bf712fb4defc7831c727d1e32d0269f7f96de0 (diff)
[CRYPTO] aead: Add givcrypt operations
This patch adds the underlying givcrypt operations for aead and associated support elements. The rationale is identical to that of the skcipher givcrypt operations, i.e., sometimes only the algorithm knows how the IV should be generated. A new request type aead_givcrypt_request is added which contains an embedded aead_request structure with two new elements to support this operation. The new elements are seq and giv. The seq field should contain a strictly increasing 64-bit integer which may be used by certain IV generators as an input value. The giv field will be used to store the generated IV. It does not need to obey the alignment requirements of the algorithm because it's not used during the operation. The existing iv field must still be available as it will be used to store intermediate IVs and the output IV if chaining is desired. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/crypto.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index 835dcaf3fe4e..7524928bff93 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -106,6 +106,7 @@ struct crypto_blkcipher;
106struct crypto_hash; 106struct crypto_hash;
107struct crypto_tfm; 107struct crypto_tfm;
108struct crypto_type; 108struct crypto_type;
109struct aead_givcrypt_request;
109struct skcipher_givcrypt_request; 110struct skcipher_givcrypt_request;
110 111
111typedef void (*crypto_completion_t)(struct crypto_async_request *req, int err); 112typedef void (*crypto_completion_t)(struct crypto_async_request *req, int err);
@@ -202,6 +203,8 @@ struct aead_alg {
202 int (*setauthsize)(struct crypto_aead *tfm, unsigned int authsize); 203 int (*setauthsize)(struct crypto_aead *tfm, unsigned int authsize);
203 int (*encrypt)(struct aead_request *req); 204 int (*encrypt)(struct aead_request *req);
204 int (*decrypt)(struct aead_request *req); 205 int (*decrypt)(struct aead_request *req);
206 int (*givencrypt)(struct aead_givcrypt_request *req);
207 int (*givdecrypt)(struct aead_givcrypt_request *req);
205 208
206 unsigned int ivsize; 209 unsigned int ivsize;
207 unsigned int maxauthsize; 210 unsigned int maxauthsize;
@@ -348,6 +351,8 @@ struct aead_tfm {
348 unsigned int keylen); 351 unsigned int keylen);
349 int (*encrypt)(struct aead_request *req); 352 int (*encrypt)(struct aead_request *req);
350 int (*decrypt)(struct aead_request *req); 353 int (*decrypt)(struct aead_request *req);
354 int (*givencrypt)(struct aead_givcrypt_request *req);
355 int (*givdecrypt)(struct aead_givcrypt_request *req);
351 unsigned int ivsize; 356 unsigned int ivsize;
352 unsigned int authsize; 357 unsigned int authsize;
353 unsigned int reqsize; 358 unsigned int reqsize;