Skip to content

Commit

Permalink
crypto: api - Move crypto attr definitions out of crypto.h
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
herbertx committed Jun 24, 2021
1 parent 74c6612 commit 5163ab5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
12 changes: 12 additions & 0 deletions crypto/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ struct crypto_larval {
u32 mask;
};

enum {
CRYPTOA_UNSPEC,
CRYPTOA_ALG,
CRYPTOA_TYPE,
__CRYPTOA_MAX,
};

#define CRYPTOA_MAX (__CRYPTOA_MAX - 1)

/* Maximum number of (rtattr) parameters for each template. */
#define CRYPTO_MAX_ATTRS 32

extern struct list_head crypto_alg_list;
extern struct rw_semaphore crypto_alg_sem;
extern struct blocking_notifier_head crypto_chain;
Expand Down
9 changes: 9 additions & 0 deletions include/crypto/algapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,15 @@ struct scatter_walk {
unsigned int offset;
};

struct crypto_attr_alg {
char name[CRYPTO_MAX_ALG_NAME];
};

struct crypto_attr_type {
u32 type;
u32 mask;
};

void crypto_mod_put(struct crypto_alg *alg);

int crypto_register_template(struct crypto_template *tmpl);
Expand Down
21 changes: 0 additions & 21 deletions include/linux/crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -643,27 +643,6 @@ struct crypto_comp {
struct crypto_tfm base;
};

enum {
CRYPTOA_UNSPEC,
CRYPTOA_ALG,
CRYPTOA_TYPE,
__CRYPTOA_MAX,
};

#define CRYPTOA_MAX (__CRYPTOA_MAX - 1)

/* Maximum number of (rtattr) parameters for each template. */
#define CRYPTO_MAX_ATTRS 32

struct crypto_attr_alg {
char name[CRYPTO_MAX_ALG_NAME];
};

struct crypto_attr_type {
u32 type;
u32 mask;
};

/*
* Transform user interface.
*/
Expand Down

0 comments on commit 5163ab5

Please sign in to comment.