From bc83b8299cb4ac2a9f64215a04854e4c934d1510 Mon Sep 17 00:00:00 2001 From: Jussi Kivilinna Date: Tue, 18 Oct 2011 00:03:08 +0300 Subject: crypto: serpent - export common functions for x86_64/i386-sse2 assembler implementations Serpent SSE2 assembler implementations only provide 4-way/8-way parallel functions and need setkey and one-block encrypt/decrypt functions. CC: Dag Arne Osvik Signed-off-by: Jussi Kivilinna Signed-off-by: Herbert Xu --- include/crypto/serpent.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 include/crypto/serpent.h (limited to 'include/crypto') diff --git a/include/crypto/serpent.h b/include/crypto/serpent.h new file mode 100644 index 00000000000..40df885f9d1 --- /dev/null +++ b/include/crypto/serpent.h @@ -0,0 +1,25 @@ +/* + * Common values for serpent algorithms + */ + +#ifndef _CRYPTO_SERPENT_H +#define _CRYPTO_SERPENT_H + +#include +#include + +#define SERPENT_MIN_KEY_SIZE 0 +#define SERPENT_MAX_KEY_SIZE 32 +#define SERPENT_EXPKEY_WORDS 132 +#define SERPENT_BLOCK_SIZE 16 + +struct serpent_ctx { + u32 expkey[SERPENT_EXPKEY_WORDS]; +}; + +int serpent_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen); + +void __serpent_encrypt(struct serpent_ctx *ctx, u8 *dst, const u8 *src); +void __serpent_decrypt(struct serpent_ctx *ctx, u8 *dst, const u8 *src); + +#endif -- cgit v1.2.3