0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef _CRYPTO_ACOMP_INT_H
0010 #define _CRYPTO_ACOMP_INT_H
0011 #include <crypto/acompress.h>
0012
0013
0014
0015
0016 static inline void *acomp_request_ctx(struct acomp_req *req)
0017 {
0018 return req->__ctx;
0019 }
0020
0021 static inline void *acomp_tfm_ctx(struct crypto_acomp *tfm)
0022 {
0023 return tfm->base.__crt_ctx;
0024 }
0025
0026 static inline void acomp_request_complete(struct acomp_req *req,
0027 int err)
0028 {
0029 req->base.complete(&req->base, err);
0030 }
0031
0032 static inline const char *acomp_alg_name(struct crypto_acomp *tfm)
0033 {
0034 return crypto_acomp_tfm(tfm)->__crt_alg->cra_name;
0035 }
0036
0037 static inline struct acomp_req *__acomp_request_alloc(struct crypto_acomp *tfm)
0038 {
0039 struct acomp_req *req;
0040
0041 req = kzalloc(sizeof(*req) + crypto_acomp_reqsize(tfm), GFP_KERNEL);
0042 if (likely(req))
0043 acomp_request_set_tfm(req, tfm);
0044 return req;
0045 }
0046
0047 static inline void __acomp_request_free(struct acomp_req *req)
0048 {
0049 kfree_sensitive(req);
0050 }
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062 int crypto_register_acomp(struct acomp_alg *alg);
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072 void crypto_unregister_acomp(struct acomp_alg *alg);
0073
0074 int crypto_register_acomps(struct acomp_alg *algs, int count);
0075 void crypto_unregister_acomps(struct acomp_alg *algs, int count);
0076
0077 #endif