crypto: kpp - Move reqsize into tfm
The value of reqsize cannot be determined in case of fallbacks. Therefore it must be stored in the tfm and not the alg object. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
@@ -53,7 +53,7 @@ static inline void *kpp_request_ctx(struct kpp_request *req)
|
|||||||
static inline void kpp_set_reqsize(struct crypto_kpp *kpp,
|
static inline void kpp_set_reqsize(struct crypto_kpp *kpp,
|
||||||
unsigned int reqsize)
|
unsigned int reqsize)
|
||||||
{
|
{
|
||||||
crypto_kpp_alg(kpp)->reqsize = reqsize;
|
kpp->reqsize = reqsize;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void *kpp_tfm_ctx(struct crypto_kpp *tfm)
|
static inline void *kpp_tfm_ctx(struct crypto_kpp *tfm)
|
||||||
|
|||||||
@@ -37,9 +37,13 @@ struct kpp_request {
|
|||||||
* struct crypto_kpp - user-instantiated object which encapsulate
|
* struct crypto_kpp - user-instantiated object which encapsulate
|
||||||
* algorithms and core processing logic
|
* algorithms and core processing logic
|
||||||
*
|
*
|
||||||
|
* @reqsize: Request context size required by algorithm
|
||||||
|
* implementation
|
||||||
* @base: Common crypto API algorithm data structure
|
* @base: Common crypto API algorithm data structure
|
||||||
*/
|
*/
|
||||||
struct crypto_kpp {
|
struct crypto_kpp {
|
||||||
|
unsigned int reqsize;
|
||||||
|
|
||||||
struct crypto_tfm base;
|
struct crypto_tfm base;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -64,8 +68,6 @@ struct crypto_kpp {
|
|||||||
* put in place here.
|
* put in place here.
|
||||||
* @exit: Undo everything @init did.
|
* @exit: Undo everything @init did.
|
||||||
*
|
*
|
||||||
* @reqsize: Request context size required by algorithm
|
|
||||||
* implementation
|
|
||||||
* @base: Common crypto API algorithm data structure
|
* @base: Common crypto API algorithm data structure
|
||||||
*/
|
*/
|
||||||
struct kpp_alg {
|
struct kpp_alg {
|
||||||
@@ -79,7 +81,6 @@ struct kpp_alg {
|
|||||||
int (*init)(struct crypto_kpp *tfm);
|
int (*init)(struct crypto_kpp *tfm);
|
||||||
void (*exit)(struct crypto_kpp *tfm);
|
void (*exit)(struct crypto_kpp *tfm);
|
||||||
|
|
||||||
unsigned int reqsize;
|
|
||||||
struct crypto_alg base;
|
struct crypto_alg base;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -128,7 +129,7 @@ static inline struct kpp_alg *crypto_kpp_alg(struct crypto_kpp *tfm)
|
|||||||
|
|
||||||
static inline unsigned int crypto_kpp_reqsize(struct crypto_kpp *tfm)
|
static inline unsigned int crypto_kpp_reqsize(struct crypto_kpp *tfm)
|
||||||
{
|
{
|
||||||
return crypto_kpp_alg(tfm)->reqsize;
|
return tfm->reqsize;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void kpp_request_set_tfm(struct kpp_request *req,
|
static inline void kpp_request_set_tfm(struct kpp_request *req,
|
||||||
|
|||||||
Reference in New Issue
Block a user