diff options
Diffstat (limited to 'include/crypto/algapi.h')
-rw-r--r-- | include/crypto/algapi.h | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/include/crypto/algapi.h b/include/crypto/algapi.h index cd721a7ce78f..4af72dc21202 100644 --- a/include/crypto/algapi.h +++ b/include/crypto/algapi.h | |||
@@ -112,7 +112,8 @@ struct crypto_tfm *crypto_spawn_tfm(struct crypto_spawn *spawn, u32 type, | |||
112 | 112 | ||
113 | struct crypto_attr_type *crypto_get_attr_type(struct rtattr **tb); | 113 | struct crypto_attr_type *crypto_get_attr_type(struct rtattr **tb); |
114 | int crypto_check_attr_type(struct rtattr **tb, u32 type); | 114 | int crypto_check_attr_type(struct rtattr **tb, u32 type); |
115 | struct crypto_alg *crypto_get_attr_alg(struct rtattr **tb, u32 type, u32 mask); | 115 | struct crypto_alg *crypto_attr_alg(struct rtattr *rta, u32 type, u32 mask); |
116 | int crypto_attr_u32(struct rtattr *rta, u32 *num); | ||
116 | struct crypto_instance *crypto_alloc_instance(const char *name, | 117 | struct crypto_instance *crypto_alloc_instance(const char *name, |
117 | struct crypto_alg *alg); | 118 | struct crypto_alg *alg); |
118 | 119 | ||
@@ -171,6 +172,26 @@ static inline struct aead_alg *crypto_aead_alg(struct crypto_aead *tfm) | |||
171 | return &crypto_aead_tfm(tfm)->__crt_alg->cra_aead; | 172 | return &crypto_aead_tfm(tfm)->__crt_alg->cra_aead; |
172 | } | 173 | } |
173 | 174 | ||
175 | static inline void *crypto_aead_ctx(struct crypto_aead *tfm) | ||
176 | { | ||
177 | return crypto_tfm_ctx(&tfm->base); | ||
178 | } | ||
179 | |||
180 | static inline struct crypto_instance *crypto_aead_alg_instance( | ||
181 | struct crypto_aead *aead) | ||
182 | { | ||
183 | return crypto_tfm_alg_instance(&aead->base); | ||
184 | } | ||
185 | |||
186 | static inline struct crypto_ablkcipher *crypto_spawn_ablkcipher( | ||
187 | struct crypto_spawn *spawn) | ||
188 | { | ||
189 | u32 type = CRYPTO_ALG_TYPE_BLKCIPHER; | ||
190 | u32 mask = CRYPTO_ALG_TYPE_MASK; | ||
191 | |||
192 | return __crypto_ablkcipher_cast(crypto_spawn_tfm(spawn, type, mask)); | ||
193 | } | ||
194 | |||
174 | static inline struct crypto_blkcipher *crypto_spawn_blkcipher( | 195 | static inline struct crypto_blkcipher *crypto_spawn_blkcipher( |
175 | struct crypto_spawn *spawn) | 196 | struct crypto_spawn *spawn) |
176 | { | 197 | { |
@@ -257,5 +278,26 @@ static inline int ablkcipher_tfm_in_queue(struct crypto_queue *queue, | |||
257 | return crypto_tfm_in_queue(queue, crypto_ablkcipher_tfm(tfm)); | 278 | return crypto_tfm_in_queue(queue, crypto_ablkcipher_tfm(tfm)); |
258 | } | 279 | } |
259 | 280 | ||
281 | static inline void *aead_request_ctx(struct aead_request *req) | ||
282 | { | ||
283 | return req->__ctx; | ||
284 | } | ||
285 | |||
286 | static inline void aead_request_complete(struct aead_request *req, int err) | ||
287 | { | ||
288 | req->base.complete(&req->base, err); | ||
289 | } | ||
290 | |||
291 | static inline u32 aead_request_flags(struct aead_request *req) | ||
292 | { | ||
293 | return req->base.flags; | ||
294 | } | ||
295 | |||
296 | static inline struct crypto_alg *crypto_get_attr_alg(struct rtattr **tb, | ||
297 | u32 type, u32 mask) | ||
298 | { | ||
299 | return crypto_attr_alg(tb[1], type, mask); | ||
300 | } | ||
301 | |||
260 | #endif /* _CRYPTO_ALGAPI_H */ | 302 | #endif /* _CRYPTO_ALGAPI_H */ |
261 | 303 | ||