diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2008-09-20 17:52:53 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2008-12-24 19:01:24 -0500 |
commit | 7b0bac64cd5b74d6f1147524c26216de13a501fd (patch) | |
tree | e9163f47d583f88d35fb8e5c9ca86ed2581c6efd /include/crypto | |
parent | 4a7794860ba2b56693b1d89fd485fd08cdc763e3 (diff) |
crypto: api - Rebirth of crypto_alloc_tfm
This patch reintroduces a completely revamped crypto_alloc_tfm.
The biggest change is that we now take two crypto_type objects
when allocating a tfm, a frontend and a backend. In fact this
simply formalises what we've been doing behind the API's back.
For example, as it stands crypto_alloc_ahash may use an
actual ahash algorithm or a crypto_hash algorithm. Putting
this in the API allows us to do this much more cleanly.
The existing types will be converted across gradually.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/crypto')
-rw-r--r-- | include/crypto/algapi.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/crypto/algapi.h b/include/crypto/algapi.h index 5fb6d8618d4d..986db68548f6 100644 --- a/include/crypto/algapi.h +++ b/include/crypto/algapi.h | |||
@@ -22,8 +22,18 @@ struct seq_file; | |||
22 | 22 | ||
23 | struct crypto_type { | 23 | struct crypto_type { |
24 | unsigned int (*ctxsize)(struct crypto_alg *alg, u32 type, u32 mask); | 24 | unsigned int (*ctxsize)(struct crypto_alg *alg, u32 type, u32 mask); |
25 | unsigned int (*extsize)(struct crypto_alg *alg, | ||
26 | const struct crypto_type *frontend); | ||
25 | int (*init)(struct crypto_tfm *tfm, u32 type, u32 mask); | 27 | int (*init)(struct crypto_tfm *tfm, u32 type, u32 mask); |
28 | int (*init_tfm)(struct crypto_tfm *tfm, | ||
29 | const struct crypto_type *frontend); | ||
26 | void (*show)(struct seq_file *m, struct crypto_alg *alg); | 30 | void (*show)(struct seq_file *m, struct crypto_alg *alg); |
31 | struct crypto_alg *(*lookup)(const char *name, u32 type, u32 mask); | ||
32 | |||
33 | unsigned int type; | ||
34 | unsigned int maskclear; | ||
35 | unsigned int maskset; | ||
36 | unsigned int tfmsize; | ||
27 | }; | 37 | }; |
28 | 38 | ||
29 | struct crypto_instance { | 39 | struct crypto_instance { |