diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2007-11-15 09:36:07 -0500 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2008-01-10 16:16:15 -0500 |
commit | 332f8840f7095d294f9bb066b175a100bcde214c (patch) | |
tree | fa2e610da8e943765dfdb8f23817027424a1339d /include/crypto | |
parent | 86f578de5ba6ea11ead9284d9f036fee01ba5893 (diff) |
[CRYPTO] ablkcipher: Add distinct ABLKCIPHER type
Up until now we have ablkcipher algorithms have been identified as
type BLKCIPHER with the ASYNC bit set. This is suboptimal because
ablkcipher refers to two things. On the one hand it refers to the
top-level ablkcipher interface with requests. On the other hand it
refers to and algorithm type underneath.
As it is you cannot request a synchronous block cipher algorithm
with the ablkcipher interface on top. This is a problem because
we want to be able to eventually phase out the blkcipher top-level
interface.
This patch fixes this by making ABLKCIPHER its own type, just as
we have distinct types for HASH and DIGEST. The type it associated
with the algorithm implementation only.
Which top-level interface is used for synchronous block ciphers is
then determined by the mask that's used. If it's a specific mask
then the old blkcipher interface is given, otherwise we go with the
new ablkcipher interface.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/crypto')
-rw-r--r-- | include/crypto/algapi.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/crypto/algapi.h b/include/crypto/algapi.h index b9b05d399d2b..88619f902c10 100644 --- a/include/crypto/algapi.h +++ b/include/crypto/algapi.h | |||
@@ -191,7 +191,7 @@ static inline struct crypto_ablkcipher *crypto_spawn_ablkcipher( | |||
191 | struct crypto_spawn *spawn) | 191 | struct crypto_spawn *spawn) |
192 | { | 192 | { |
193 | u32 type = CRYPTO_ALG_TYPE_BLKCIPHER; | 193 | u32 type = CRYPTO_ALG_TYPE_BLKCIPHER; |
194 | u32 mask = CRYPTO_ALG_TYPE_MASK; | 194 | u32 mask = CRYPTO_ALG_TYPE_BLKCIPHER_MASK; |
195 | 195 | ||
196 | return __crypto_ablkcipher_cast(crypto_spawn_tfm(spawn, type, mask)); | 196 | return __crypto_ablkcipher_cast(crypto_spawn_tfm(spawn, type, mask)); |
197 | } | 197 | } |
@@ -200,7 +200,7 @@ static inline struct crypto_blkcipher *crypto_spawn_blkcipher( | |||
200 | struct crypto_spawn *spawn) | 200 | struct crypto_spawn *spawn) |
201 | { | 201 | { |
202 | u32 type = CRYPTO_ALG_TYPE_BLKCIPHER; | 202 | u32 type = CRYPTO_ALG_TYPE_BLKCIPHER; |
203 | u32 mask = CRYPTO_ALG_TYPE_MASK | CRYPTO_ALG_ASYNC; | 203 | u32 mask = CRYPTO_ALG_TYPE_MASK; |
204 | 204 | ||
205 | return __crypto_blkcipher_cast(crypto_spawn_tfm(spawn, type, mask)); | 205 | return __crypto_blkcipher_cast(crypto_spawn_tfm(spawn, type, mask)); |
206 | } | 206 | } |