diff options
| author | Jussi Kivilinna <jussi.kivilinna@mbnet.fi> | 2012-11-13 04:43:14 -0500 |
|---|---|---|
| committer | Herbert Xu <herbert@gondor.apana.org.au> | 2012-12-06 04:16:26 -0500 |
| commit | 044ab5257806310a0150146df3b74b8adaa4ebcf (patch) | |
| tree | 0396b6068d9547c28841c1808c48adf97e474e60 /include/crypto | |
| parent | f0fcf2002bf122afe8fe1b74b2cee3710c7e6cd9 (diff) | |
crypto: cast5/cast6 - move lookup tables to shared module
CAST5 and CAST6 both use same lookup tables, which can be moved shared module
'cast_common'.
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/crypto')
| -rw-r--r-- | include/crypto/cast5.h | 6 | ||||
| -rw-r--r-- | include/crypto/cast6.h | 6 | ||||
| -rw-r--r-- | include/crypto/cast_common.h | 9 |
3 files changed, 11 insertions, 10 deletions
diff --git a/include/crypto/cast5.h b/include/crypto/cast5.h index 586183a0406e..14fbf39d6380 100644 --- a/include/crypto/cast5.h +++ b/include/crypto/cast5.h | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | #include <linux/crypto.h> | 5 | #include <linux/crypto.h> |
| 6 | #include <crypto/cast_common.h> | ||
| 6 | 7 | ||
| 7 | #define CAST5_BLOCK_SIZE 8 | 8 | #define CAST5_BLOCK_SIZE 8 |
| 8 | #define CAST5_MIN_KEY_SIZE 5 | 9 | #define CAST5_MIN_KEY_SIZE 5 |
| @@ -19,9 +20,4 @@ int cast5_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen); | |||
| 19 | void __cast5_encrypt(struct cast5_ctx *ctx, u8 *dst, const u8 *src); | 20 | void __cast5_encrypt(struct cast5_ctx *ctx, u8 *dst, const u8 *src); |
| 20 | void __cast5_decrypt(struct cast5_ctx *ctx, u8 *dst, const u8 *src); | 21 | void __cast5_decrypt(struct cast5_ctx *ctx, u8 *dst, const u8 *src); |
| 21 | 22 | ||
| 22 | extern const u32 cast5_s1[256]; | ||
| 23 | extern const u32 cast5_s2[256]; | ||
| 24 | extern const u32 cast5_s3[256]; | ||
| 25 | extern const u32 cast5_s4[256]; | ||
| 26 | |||
| 27 | #endif | 23 | #endif |
diff --git a/include/crypto/cast6.h b/include/crypto/cast6.h index 157af6f342c8..32b60eb8bd24 100644 --- a/include/crypto/cast6.h +++ b/include/crypto/cast6.h | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | #include <linux/crypto.h> | 5 | #include <linux/crypto.h> |
| 6 | #include <crypto/cast_common.h> | ||
| 6 | 7 | ||
| 7 | #define CAST6_BLOCK_SIZE 16 | 8 | #define CAST6_BLOCK_SIZE 16 |
| 8 | #define CAST6_MIN_KEY_SIZE 16 | 9 | #define CAST6_MIN_KEY_SIZE 16 |
| @@ -20,9 +21,4 @@ int cast6_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen); | |||
| 20 | void __cast6_encrypt(struct cast6_ctx *ctx, u8 *dst, const u8 *src); | 21 | void __cast6_encrypt(struct cast6_ctx *ctx, u8 *dst, const u8 *src); |
| 21 | void __cast6_decrypt(struct cast6_ctx *ctx, u8 *dst, const u8 *src); | 22 | void __cast6_decrypt(struct cast6_ctx *ctx, u8 *dst, const u8 *src); |
| 22 | 23 | ||
| 23 | extern const u32 cast6_s1[256]; | ||
| 24 | extern const u32 cast6_s2[256]; | ||
| 25 | extern const u32 cast6_s3[256]; | ||
| 26 | extern const u32 cast6_s4[256]; | ||
| 27 | |||
| 28 | #endif | 24 | #endif |
diff --git a/include/crypto/cast_common.h b/include/crypto/cast_common.h new file mode 100644 index 000000000000..b7df35cd9f0a --- /dev/null +++ b/include/crypto/cast_common.h | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | #ifndef _CRYPTO_CAST_COMMON_H | ||
| 2 | #define _CRYPTO_CAST_COMMON_H | ||
| 3 | |||
| 4 | extern const u32 cast_s1[256]; | ||
| 5 | extern const u32 cast_s2[256]; | ||
| 6 | extern const u32 cast_s3[256]; | ||
| 7 | extern const u32 cast_s4[256]; | ||
| 8 | |||
| 9 | #endif | ||
