aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/internal.h
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2006-09-20 21:35:17 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2006-09-20 21:35:17 -0400
commit492e2b63eb10c28f4f0b694264d74a8755cd1be0 (patch)
treed882a2df15d939b2edf9064963d73c71c5985b9b /crypto/internal.h
parent2b8c19dbdc692e81243a328725a02efb77b144a5 (diff)
[CRYPTO] api: Allow algorithm lookup by type
This patch also adds the infrastructure to pick an algorithm based on their type. For example, this allows you to select the encryption algorithm "aes", instead of any algorithm registered under the name "aes". For now this is only accessible internally. Eventually it will be made available through crypto_alloc_tfm. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'crypto/internal.h')
-rw-r--r--crypto/internal.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/crypto/internal.h b/crypto/internal.h
index 3a08d25fba45..c08d93bdadc4 100644
--- a/crypto/internal.h
+++ b/crypto/internal.h
@@ -43,6 +43,7 @@ struct crypto_larval {
43 struct crypto_alg alg; 43 struct crypto_alg alg;
44 struct crypto_alg *adult; 44 struct crypto_alg *adult;
45 struct completion completion; 45 struct completion completion;
46 u32 mask;
46}; 47};
47 48
48extern struct list_head crypto_alg_list; 49extern struct list_head crypto_alg_list;
@@ -124,7 +125,8 @@ static inline unsigned int crypto_compress_ctxsize(struct crypto_alg *alg,
124 125
125struct crypto_alg *crypto_mod_get(struct crypto_alg *alg); 126struct crypto_alg *crypto_mod_get(struct crypto_alg *alg);
126void crypto_mod_put(struct crypto_alg *alg); 127void crypto_mod_put(struct crypto_alg *alg);
127struct crypto_alg *__crypto_alg_lookup(const char *name); 128struct crypto_alg *__crypto_alg_lookup(const char *name, u32 type, u32 mask);
129struct crypto_alg *crypto_alg_mod_lookup(const char *name, u32 type, u32 mask);
128 130
129int crypto_init_digest_flags(struct crypto_tfm *tfm, u32 flags); 131int crypto_init_digest_flags(struct crypto_tfm *tfm, u32 flags);
130int crypto_init_cipher_flags(struct crypto_tfm *tfm, u32 flags); 132int crypto_init_cipher_flags(struct crypto_tfm *tfm, u32 flags);
@@ -138,7 +140,7 @@ void crypto_exit_digest_ops(struct crypto_tfm *tfm);
138void crypto_exit_cipher_ops(struct crypto_tfm *tfm); 140void crypto_exit_cipher_ops(struct crypto_tfm *tfm);
139void crypto_exit_compress_ops(struct crypto_tfm *tfm); 141void crypto_exit_compress_ops(struct crypto_tfm *tfm);
140 142
141void crypto_larval_error(const char *name); 143void crypto_larval_error(const char *name, u32 type, u32 mask);
142 144
143int crypto_register_instance(struct crypto_template *tmpl, 145int crypto_register_instance(struct crypto_template *tmpl,
144 struct crypto_instance *inst); 146 struct crypto_instance *inst);