diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-21 17:46:51 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-21 17:46:51 -0400 |
commit | 2a8ba8f032160552a3beffab8aae9019ff477504 (patch) | |
tree | b50f70a3c8f7c2e179e1587d33ea3542d68525f9 /include/crypto/algapi.h | |
parent | ec2a7587e0a91d5c1afe23a0a73edfce06c5e4e0 (diff) | |
parent | e954bc91bdd4bb08b8325478c5004b24a23a3522 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (46 commits)
random: simplify fips mode
crypto: authenc - Fix cryptlen calculation
crypto: talitos - add support for sha224
crypto: talitos - add hash algorithms
crypto: talitos - second prepare step for adding ahash algorithms
crypto: talitos - prepare for adding ahash algorithms
crypto: n2 - Add Niagara2 crypto driver
crypto: skcipher - Add ablkcipher_walk interfaces
crypto: testmgr - Add testing for async hashing and update/final
crypto: tcrypt - Add speed tests for async hashing
crypto: scatterwalk - Fix scatterwalk_done() test
crypto: hifn_795x - Rename ablkcipher_walk to hifn_cipher_walk
padata: Use get_online_cpus/put_online_cpus in padata_free
padata: Add some code comments
padata: Flush the padata queues actively
padata: Use a timer to handle remaining objects in the reorder queues
crypto: shash - Remove usage of CRYPTO_MINALIGN
crypto: mv_cesa - Use resource_size
crypto: omap - OMAP macros corrected
padata: Use get_online_cpus/put_online_cpus
...
Fix up conflicts in arch/arm/mach-omap2/devices.c
Diffstat (limited to 'include/crypto/algapi.h')
-rw-r--r-- | include/crypto/algapi.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/include/crypto/algapi.h b/include/crypto/algapi.h index fc0d575c71e0..59c3e5bd2c06 100644 --- a/include/crypto/algapi.h +++ b/include/crypto/algapi.h | |||
@@ -103,6 +103,23 @@ struct blkcipher_walk { | |||
103 | unsigned int blocksize; | 103 | unsigned int blocksize; |
104 | }; | 104 | }; |
105 | 105 | ||
106 | struct ablkcipher_walk { | ||
107 | struct { | ||
108 | struct page *page; | ||
109 | unsigned int offset; | ||
110 | } src, dst; | ||
111 | |||
112 | struct scatter_walk in; | ||
113 | unsigned int nbytes; | ||
114 | struct scatter_walk out; | ||
115 | unsigned int total; | ||
116 | struct list_head buffers; | ||
117 | u8 *iv_buffer; | ||
118 | u8 *iv; | ||
119 | int flags; | ||
120 | unsigned int blocksize; | ||
121 | }; | ||
122 | |||
106 | extern const struct crypto_type crypto_ablkcipher_type; | 123 | extern const struct crypto_type crypto_ablkcipher_type; |
107 | extern const struct crypto_type crypto_aead_type; | 124 | extern const struct crypto_type crypto_aead_type; |
108 | extern const struct crypto_type crypto_blkcipher_type; | 125 | extern const struct crypto_type crypto_blkcipher_type; |
@@ -173,6 +190,12 @@ int blkcipher_walk_virt_block(struct blkcipher_desc *desc, | |||
173 | struct blkcipher_walk *walk, | 190 | struct blkcipher_walk *walk, |
174 | unsigned int blocksize); | 191 | unsigned int blocksize); |
175 | 192 | ||
193 | int ablkcipher_walk_done(struct ablkcipher_request *req, | ||
194 | struct ablkcipher_walk *walk, int err); | ||
195 | int ablkcipher_walk_phys(struct ablkcipher_request *req, | ||
196 | struct ablkcipher_walk *walk); | ||
197 | void __ablkcipher_walk_complete(struct ablkcipher_walk *walk); | ||
198 | |||
176 | static inline void *crypto_tfm_ctx_aligned(struct crypto_tfm *tfm) | 199 | static inline void *crypto_tfm_ctx_aligned(struct crypto_tfm *tfm) |
177 | { | 200 | { |
178 | return PTR_ALIGN(crypto_tfm_ctx(tfm), | 201 | return PTR_ALIGN(crypto_tfm_ctx(tfm), |
@@ -283,6 +306,23 @@ static inline void blkcipher_walk_init(struct blkcipher_walk *walk, | |||
283 | walk->total = nbytes; | 306 | walk->total = nbytes; |
284 | } | 307 | } |
285 | 308 | ||
309 | static inline void ablkcipher_walk_init(struct ablkcipher_walk *walk, | ||
310 | struct scatterlist *dst, | ||
311 | struct scatterlist *src, | ||
312 | unsigned int nbytes) | ||
313 | { | ||
314 | walk->in.sg = src; | ||
315 | walk->out.sg = dst; | ||
316 | walk->total = nbytes; | ||
317 | INIT_LIST_HEAD(&walk->buffers); | ||
318 | } | ||
319 | |||
320 | static inline void ablkcipher_walk_complete(struct ablkcipher_walk *walk) | ||
321 | { | ||
322 | if (unlikely(!list_empty(&walk->buffers))) | ||
323 | __ablkcipher_walk_complete(walk); | ||
324 | } | ||
325 | |||
286 | static inline struct crypto_async_request *crypto_get_backlog( | 326 | static inline struct crypto_async_request *crypto_get_backlog( |
287 | struct crypto_queue *queue) | 327 | struct crypto_queue *queue) |
288 | { | 328 | { |