Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Jussi Kivilinna | bc83b82 | 2011-10-18 00:03:08 +0300 | [diff] [blame] | 2 | /* |
| 3 | * Common values for serpent algorithms |
| 4 | */ |
| 5 | |
| 6 | #ifndef _CRYPTO_SERPENT_H |
| 7 | #define _CRYPTO_SERPENT_H |
| 8 | |
| 9 | #include <linux/types.h> |
| 10 | #include <linux/crypto.h> |
| 11 | |
| 12 | #define SERPENT_MIN_KEY_SIZE 0 |
| 13 | #define SERPENT_MAX_KEY_SIZE 32 |
| 14 | #define SERPENT_EXPKEY_WORDS 132 |
| 15 | #define SERPENT_BLOCK_SIZE 16 |
| 16 | |
| 17 | struct serpent_ctx { |
| 18 | u32 expkey[SERPENT_EXPKEY_WORDS]; |
| 19 | }; |
| 20 | |
Jussi Kivilinna | 1848205 | 2011-11-09 16:26:36 +0200 | [diff] [blame] | 21 | int __serpent_setkey(struct serpent_ctx *ctx, const u8 *key, |
| 22 | unsigned int keylen); |
Jussi Kivilinna | bc83b82 | 2011-10-18 00:03:08 +0300 | [diff] [blame] | 23 | int serpent_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen); |
| 24 | |
| 25 | void __serpent_encrypt(struct serpent_ctx *ctx, u8 *dst, const u8 *src); |
| 26 | void __serpent_decrypt(struct serpent_ctx *ctx, u8 *dst, const u8 *src); |
| 27 | |
| 28 | #endif |