summaryrefslogtreecommitdiff
path: root/include/crypto/akcipher.h
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2022-11-22 18:03:35 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2022-12-02 18:12:39 +0800
commit3e71e5b0efcc730216f4450b796df4fdd627ecd0 (patch)
tree6d6024e5172e1cf9e7373231fd59a40ef7023fbb /include/crypto/akcipher.h
parent93c446cd36a410b31519af7a2dd32e899cc03d06 (diff)
downloadlwn-3e71e5b0efcc730216f4450b796df4fdd627ecd0.tar.gz
lwn-3e71e5b0efcc730216f4450b796df4fdd627ecd0.zip
crypto: akcipher - 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/akcipher.h')
-rw-r--r--include/crypto/akcipher.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/crypto/akcipher.h b/include/crypto/akcipher.h
index 5764b46bd1ec..734c213918bd 100644
--- a/include/crypto/akcipher.h
+++ b/include/crypto/akcipher.h
@@ -43,9 +43,12 @@ struct akcipher_request {
* struct crypto_akcipher - user-instantiated objects which encapsulate
* algorithms and core processing logic
*
+ * @reqsize: Request context size required by algorithm implementation
* @base: Common crypto API algorithm data structure
*/
struct crypto_akcipher {
+ unsigned int reqsize;
+
struct crypto_tfm base;
};
@@ -86,7 +89,6 @@ struct crypto_akcipher {
* counterpart to @init, used to remove various changes set in
* @init.
*
- * @reqsize: Request context size required by algorithm implementation
* @base: Common crypto API algorithm data structure
*/
struct akcipher_alg {
@@ -102,7 +104,6 @@ struct akcipher_alg {
int (*init)(struct crypto_akcipher *tfm);
void (*exit)(struct crypto_akcipher *tfm);
- unsigned int reqsize;
struct crypto_alg base;
};
@@ -155,7 +156,7 @@ static inline struct akcipher_alg *crypto_akcipher_alg(
static inline unsigned int crypto_akcipher_reqsize(struct crypto_akcipher *tfm)
{
- return crypto_akcipher_alg(tfm)->reqsize;
+ return tfm->reqsize;
}
static inline void akcipher_request_set_tfm(struct akcipher_request *req,