mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
[CRYPTO] api: Add ablkcipher_request_set_tfm
This patch adds ablkcipher_request_set_tfm for those users that need to manage the memory for ablkcipher requests directly. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
124b53d020
commit
e196d62591
@ -588,6 +588,12 @@ static inline int crypto_ablkcipher_reqsize(struct crypto_ablkcipher *tfm)
|
|||||||
return crypto_ablkcipher_crt(tfm)->reqsize;
|
return crypto_ablkcipher_crt(tfm)->reqsize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void ablkcipher_request_set_tfm(
|
||||||
|
struct ablkcipher_request *req, struct crypto_ablkcipher *tfm)
|
||||||
|
{
|
||||||
|
req->base.tfm = crypto_ablkcipher_tfm(tfm);
|
||||||
|
}
|
||||||
|
|
||||||
static inline struct ablkcipher_request *ablkcipher_request_cast(
|
static inline struct ablkcipher_request *ablkcipher_request_cast(
|
||||||
struct crypto_async_request *req)
|
struct crypto_async_request *req)
|
||||||
{
|
{
|
||||||
@ -603,7 +609,7 @@ static inline struct ablkcipher_request *ablkcipher_request_alloc(
|
|||||||
crypto_ablkcipher_reqsize(tfm), gfp);
|
crypto_ablkcipher_reqsize(tfm), gfp);
|
||||||
|
|
||||||
if (likely(req))
|
if (likely(req))
|
||||||
req->base.tfm = crypto_ablkcipher_tfm(tfm);
|
ablkcipher_request_set_tfm(req, tfm);
|
||||||
|
|
||||||
return req;
|
return req;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user