diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2022-11-22 18:09:16 +0800 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2022-12-02 18:12:40 +0800 |
commit | 4d2b225a67e6df962bbeaad473bfd8f97cfbf478 (patch) | |
tree | aaef2295223ccfb6b261eb49b3e37429187fa943 /include/crypto/kpp.h | |
parent | cb99fc0dd1f6985e8b6ade93e3d69f5e33930539 (diff) | |
download | lwn-4d2b225a67e6df962bbeaad473bfd8f97cfbf478.tar.gz lwn-4d2b225a67e6df962bbeaad473bfd8f97cfbf478.zip |
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>
Diffstat (limited to 'include/crypto/kpp.h')
-rw-r--r-- | include/crypto/kpp.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/include/crypto/kpp.h b/include/crypto/kpp.h index 24d01e9877c1..33ff32878802 100644 --- a/include/crypto/kpp.h +++ b/include/crypto/kpp.h @@ -37,9 +37,13 @@ struct kpp_request { * struct crypto_kpp - user-instantiated object which encapsulate * algorithms and core processing logic * + * @reqsize: Request context size required by algorithm + * implementation * @base: Common crypto API algorithm data structure */ struct crypto_kpp { + unsigned int reqsize; + struct crypto_tfm base; }; @@ -64,8 +68,6 @@ struct crypto_kpp { * put in place here. * @exit: Undo everything @init did. * - * @reqsize: Request context size required by algorithm - * implementation * @base: Common crypto API algorithm data structure */ struct kpp_alg { @@ -79,7 +81,6 @@ struct kpp_alg { int (*init)(struct crypto_kpp *tfm); void (*exit)(struct crypto_kpp *tfm); - unsigned int reqsize; 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) { - return crypto_kpp_alg(tfm)->reqsize; + return tfm->reqsize; } static inline void kpp_request_set_tfm(struct kpp_request *req, |