Skip to content

Commit 5163ab5

Browse files
committed
crypto: api - Move crypto attr definitions out of crypto.h
The definitions for crypto_attr-related types and enums are not needed by most Crypto API users. This patch moves them out of crypto.h and into algapi.h/internal.h depending on the extent of their use. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 74c6612 commit 5163ab5

3 files changed

Lines changed: 21 additions & 21 deletions

File tree

crypto/internal.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@ struct crypto_larval {
2929
u32 mask;
3030
};
3131

32+
enum {
33+
CRYPTOA_UNSPEC,
34+
CRYPTOA_ALG,
35+
CRYPTOA_TYPE,
36+
__CRYPTOA_MAX,
37+
};
38+
39+
#define CRYPTOA_MAX (__CRYPTOA_MAX - 1)
40+
41+
/* Maximum number of (rtattr) parameters for each template. */
42+
#define CRYPTO_MAX_ATTRS 32
43+
3244
extern struct list_head crypto_alg_list;
3345
extern struct rw_semaphore crypto_alg_sem;
3446
extern struct blocking_notifier_head crypto_chain;

include/crypto/algapi.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,15 @@ struct scatter_walk {
9696
unsigned int offset;
9797
};
9898

99+
struct crypto_attr_alg {
100+
char name[CRYPTO_MAX_ALG_NAME];
101+
};
102+
103+
struct crypto_attr_type {
104+
u32 type;
105+
u32 mask;
106+
};
107+
99108
void crypto_mod_put(struct crypto_alg *alg);
100109

101110
int crypto_register_template(struct crypto_template *tmpl);

include/linux/crypto.h

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -643,27 +643,6 @@ struct crypto_comp {
643643
struct crypto_tfm base;
644644
};
645645

646-
enum {
647-
CRYPTOA_UNSPEC,
648-
CRYPTOA_ALG,
649-
CRYPTOA_TYPE,
650-
__CRYPTOA_MAX,
651-
};
652-
653-
#define CRYPTOA_MAX (__CRYPTOA_MAX - 1)
654-
655-
/* Maximum number of (rtattr) parameters for each template. */
656-
#define CRYPTO_MAX_ATTRS 32
657-
658-
struct crypto_attr_alg {
659-
char name[CRYPTO_MAX_ALG_NAME];
660-
};
661-
662-
struct crypto_attr_type {
663-
u32 type;
664-
u32 mask;
665-
};
666-
667646
/*
668647
* Transform user interface.
669648
*/

0 commit comments

Comments
 (0)