diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/crypto/algapi.h | 4 | ||||
-rw-r--r-- | include/linux/crypto.h | 18 |
2 files changed, 12 insertions, 10 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 | } |
diff --git a/include/linux/crypto.h b/include/linux/crypto.h index f3110ebe894a..f56ae8721bc9 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h | |||
@@ -33,10 +33,12 @@ | |||
33 | #define CRYPTO_ALG_TYPE_DIGEST 0x00000002 | 33 | #define CRYPTO_ALG_TYPE_DIGEST 0x00000002 |
34 | #define CRYPTO_ALG_TYPE_HASH 0x00000003 | 34 | #define CRYPTO_ALG_TYPE_HASH 0x00000003 |
35 | #define CRYPTO_ALG_TYPE_BLKCIPHER 0x00000004 | 35 | #define CRYPTO_ALG_TYPE_BLKCIPHER 0x00000004 |
36 | #define CRYPTO_ALG_TYPE_COMPRESS 0x00000005 | 36 | #define CRYPTO_ALG_TYPE_ABLKCIPHER 0x00000005 |
37 | #define CRYPTO_ALG_TYPE_AEAD 0x00000006 | 37 | #define CRYPTO_ALG_TYPE_COMPRESS 0x00000008 |
38 | #define CRYPTO_ALG_TYPE_AEAD 0x00000009 | ||
38 | 39 | ||
39 | #define CRYPTO_ALG_TYPE_HASH_MASK 0x0000000e | 40 | #define CRYPTO_ALG_TYPE_HASH_MASK 0x0000000e |
41 | #define CRYPTO_ALG_TYPE_BLKCIPHER_MASK 0x0000000c | ||
40 | 42 | ||
41 | #define CRYPTO_ALG_LARVAL 0x00000010 | 43 | #define CRYPTO_ALG_LARVAL 0x00000010 |
42 | #define CRYPTO_ALG_DEAD 0x00000020 | 44 | #define CRYPTO_ALG_DEAD 0x00000020 |
@@ -530,7 +532,7 @@ static inline struct crypto_ablkcipher *crypto_alloc_ablkcipher( | |||
530 | { | 532 | { |
531 | type &= ~CRYPTO_ALG_TYPE_MASK; | 533 | type &= ~CRYPTO_ALG_TYPE_MASK; |
532 | type |= CRYPTO_ALG_TYPE_BLKCIPHER; | 534 | type |= CRYPTO_ALG_TYPE_BLKCIPHER; |
533 | mask |= CRYPTO_ALG_TYPE_MASK; | 535 | mask |= CRYPTO_ALG_TYPE_BLKCIPHER_MASK; |
534 | 536 | ||
535 | return __crypto_ablkcipher_cast( | 537 | return __crypto_ablkcipher_cast( |
536 | crypto_alloc_base(alg_name, type, mask)); | 538 | crypto_alloc_base(alg_name, type, mask)); |
@@ -552,7 +554,7 @@ static inline int crypto_has_ablkcipher(const char *alg_name, u32 type, | |||
552 | { | 554 | { |
553 | type &= ~CRYPTO_ALG_TYPE_MASK; | 555 | type &= ~CRYPTO_ALG_TYPE_MASK; |
554 | type |= CRYPTO_ALG_TYPE_BLKCIPHER; | 556 | type |= CRYPTO_ALG_TYPE_BLKCIPHER; |
555 | mask |= CRYPTO_ALG_TYPE_MASK; | 557 | mask |= CRYPTO_ALG_TYPE_BLKCIPHER_MASK; |
556 | 558 | ||
557 | return crypto_has_alg(alg_name, type, mask); | 559 | return crypto_has_alg(alg_name, type, mask); |
558 | } | 560 | } |
@@ -841,9 +843,9 @@ static inline struct crypto_blkcipher *crypto_blkcipher_cast( | |||
841 | static inline struct crypto_blkcipher *crypto_alloc_blkcipher( | 843 | static inline struct crypto_blkcipher *crypto_alloc_blkcipher( |
842 | const char *alg_name, u32 type, u32 mask) | 844 | const char *alg_name, u32 type, u32 mask) |
843 | { | 845 | { |
844 | type &= ~(CRYPTO_ALG_TYPE_MASK | CRYPTO_ALG_ASYNC); | 846 | type &= ~CRYPTO_ALG_TYPE_MASK; |
845 | type |= CRYPTO_ALG_TYPE_BLKCIPHER; | 847 | type |= CRYPTO_ALG_TYPE_BLKCIPHER; |
846 | mask |= CRYPTO_ALG_TYPE_MASK | CRYPTO_ALG_ASYNC; | 848 | mask |= CRYPTO_ALG_TYPE_MASK; |
847 | 849 | ||
848 | return __crypto_blkcipher_cast(crypto_alloc_base(alg_name, type, mask)); | 850 | return __crypto_blkcipher_cast(crypto_alloc_base(alg_name, type, mask)); |
849 | } | 851 | } |
@@ -861,9 +863,9 @@ static inline void crypto_free_blkcipher(struct crypto_blkcipher *tfm) | |||
861 | 863 | ||
862 | static inline int crypto_has_blkcipher(const char *alg_name, u32 type, u32 mask) | 864 | static inline int crypto_has_blkcipher(const char *alg_name, u32 type, u32 mask) |
863 | { | 865 | { |
864 | type &= ~(CRYPTO_ALG_TYPE_MASK | CRYPTO_ALG_ASYNC); | 866 | type &= ~CRYPTO_ALG_TYPE_MASK; |
865 | type |= CRYPTO_ALG_TYPE_BLKCIPHER; | 867 | type |= CRYPTO_ALG_TYPE_BLKCIPHER; |
866 | mask |= CRYPTO_ALG_TYPE_MASK | CRYPTO_ALG_ASYNC; | 868 | mask |= CRYPTO_ALG_TYPE_MASK; |
867 | 869 | ||
868 | return crypto_has_alg(alg_name, type, mask); | 870 | return crypto_has_alg(alg_name, type, mask); |
869 | } | 871 | } |