History

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.

Herbert Xu committed 3 years ago

Commit 4d2b2251 parent cb99fc02 files · +6 −5Browse files

Unified · Split

2 files
  1. include/crypto/internal/kpp.h +1 −1
  2. include/crypto/kpp.h +5 −4
include/crypto/internal/kpp.h+1−1
@@ -53,7 +53,7 @@ static inline void *kpp_request_ctx(struct kpp_request *req) · 52 unmodified lines
5353 static inline void kpp_set_reqsize(struct crypto_kpp *kpp,
5454 unsigned int reqsize)
5555 {
56− crypto_kpp_alg(kpp)->reqsize = reqsize;
56+ kpp->reqsize = reqsize;
5757 }
5858
5959 static inline void *kpp_tfm_ctx(struct crypto_kpp *tfm)
include/crypto/kpp.h+5−4
@@ -37,9 +37,13 @@ struct kpp_request { · 36 unmodified lines
3737 * struct crypto_kpp - user-instantiated object which encapsulate
3838 * algorithms and core processing logic
3939 *
40+ * @reqsize: Request context size required by algorithm
41+ * implementation
4042 * @base: Common crypto API algorithm data structure
4143 */
4244 struct crypto_kpp {
45+ unsigned int reqsize;
46+
4347 struct crypto_tfm base;
4448 };
4549
@@ -64,8 +68,6 @@ struct crypto_kpp { · 18 unmodified lines
6468 * put in place here.
6569 * @exit: Undo everything @init did.
6670 *
67− * @reqsize: Request context size required by algorithm
68− * implementation
6971 * @base: Common crypto API algorithm data structure
7072 */
7173 struct kpp_alg {
@@ -79,7 +81,6 @@ struct kpp_alg { · 7 unmodified lines
7981 int (*init)(struct crypto_kpp *tfm);
8082 void (*exit)(struct crypto_kpp *tfm);
8183
82− unsigned int reqsize;
8384 struct crypto_alg base;
8485 };
8586
@@ -128,7 +129,7 @@ static inline struct kpp_alg *crypto_kpp_alg(struct crypto_kpp *tfm) · 42 unmodified lines
128129
129130 static inline unsigned int crypto_kpp_reqsize(struct crypto_kpp *tfm)
130131 {
131− return crypto_kpp_alg(tfm)->reqsize;
132+ return tfm->reqsize;
132133 }
133134
134135 static inline void kpp_request_set_tfm(struct kpp_request *req,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t