diff options
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 | { |
