0001
0002
0003
0004
0005
0006 #ifndef __CRYPTO_DES_H
0007 #define __CRYPTO_DES_H
0008
0009 #include <linux/types.h>
0010
0011 #define DES_KEY_SIZE 8
0012 #define DES_EXPKEY_WORDS 32
0013 #define DES_BLOCK_SIZE 8
0014
0015 #define DES3_EDE_KEY_SIZE (3 * DES_KEY_SIZE)
0016 #define DES3_EDE_EXPKEY_WORDS (3 * DES_EXPKEY_WORDS)
0017 #define DES3_EDE_BLOCK_SIZE DES_BLOCK_SIZE
0018
0019 struct des_ctx {
0020 u32 expkey[DES_EXPKEY_WORDS];
0021 };
0022
0023 struct des3_ede_ctx {
0024 u32 expkey[DES3_EDE_EXPKEY_WORDS];
0025 };
0026
0027 void des_encrypt(const struct des_ctx *ctx, u8 *dst, const u8 *src);
0028 void des_decrypt(const struct des_ctx *ctx, u8 *dst, const u8 *src);
0029
0030 void des3_ede_encrypt(const struct des3_ede_ctx *dctx, u8 *dst, const u8 *src);
0031 void des3_ede_decrypt(const struct des3_ede_ctx *dctx, u8 *dst, const u8 *src);
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042 int des_expand_key(struct des_ctx *ctx, const u8 *key, unsigned int keylen);
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054 int des3_ede_expand_key(struct des3_ede_ctx *ctx, const u8 *key,
0055 unsigned int keylen);
0056
0057 #endif