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

Showing the changes to include/crypto (2 of 2 files). Show all

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
53static inline void kpp_set_reqsize(struct crypto_kpp *kpp,53static inline void kpp_set_reqsize(struct crypto_kpp *kpp,
54 unsigned int reqsize)54 unsigned int reqsize)
55{55{
56 crypto_kpp_alg(kpp)->reqsize = reqsize;56 kpp->reqsize = reqsize;
57}57}
58 58
59static inline void *kpp_tfm_ctx(struct crypto_kpp *tfm)59static 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
37 * struct crypto_kpp - user-instantiated object which encapsulate37 * struct crypto_kpp - user-instantiated object which encapsulate
38 * algorithms and core processing logic38 * algorithms and core processing logic
39 *39 *
40 * @reqsize: Request context size required by algorithm
41 * implementation
40 * @base: Common crypto API algorithm data structure42 * @base: Common crypto API algorithm data structure
41 */43 */
42struct crypto_kpp {44struct crypto_kpp {
45 unsigned int reqsize;
46
43 struct crypto_tfm base;47 struct crypto_tfm base;
44};48};
45 49
@@ -64,8 +68,6 @@ struct crypto_kpp { · 18 unmodified lines
64 * put in place here.68 * put in place here.
65 * @exit: Undo everything @init did.69 * @exit: Undo everything @init did.
66 *70 *
67 * @reqsize: Request context size required by algorithm
68 * implementation
69 * @base: Common crypto API algorithm data structure71 * @base: Common crypto API algorithm data structure
70 */72 */
71struct kpp_alg {73struct kpp_alg {
@@ -79,7 +81,6 @@ struct kpp_alg { · 7 unmodified lines
79 int (*init)(struct crypto_kpp *tfm);81 int (*init)(struct crypto_kpp *tfm);
80 void (*exit)(struct crypto_kpp *tfm);82 void (*exit)(struct crypto_kpp *tfm);
81 83
82 unsigned int reqsize;
83 struct crypto_alg base;84 struct crypto_alg base;
84};85};
85 86
@@ -128,7 +129,7 @@ static inline struct kpp_alg *crypto_kpp_alg(struct crypto_kpp *tfm) · 42 unmodified lines
128 129
129static inline unsigned int crypto_kpp_reqsize(struct crypto_kpp *tfm)130static inline unsigned int crypto_kpp_reqsize(struct crypto_kpp *tfm)
130{131{
131 return crypto_kpp_alg(tfm)->reqsize;132 return tfm->reqsize;
132}133}
133 134
134static inline void kpp_request_set_tfm(struct kpp_request *req,135static 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