From b0d8ed94fe9e74afb49fdf5f11e4add29879c65c Mon Sep 17 00:00:00 2001 From: Rene Mayrhofer Date: Thu, 12 Apr 2007 20:30:08 +0000 Subject: [svn-upgrade] Integrating new upstream version, strongswan (4.1.1) --- src/libcrypto/libtwofish/twofish.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/libcrypto/libtwofish/twofish.h (limited to 'src/libcrypto/libtwofish/twofish.h') diff --git a/src/libcrypto/libtwofish/twofish.h b/src/libcrypto/libtwofish/twofish.h new file mode 100644 index 000000000..9b289f265 --- /dev/null +++ b/src/libcrypto/libtwofish/twofish.h @@ -0,0 +1,20 @@ +#ifndef TWOFISH_H +#define TWOFISH_H +#ifdef __KERNEL__ +#include +#else +#include +#endif +/* Structure for an expanded Twofish key. s contains the key-dependent + * S-boxes composed with the MDS matrix; w contains the eight "whitening" + * subkeys, K[0] through K[7]. k holds the remaining, "round" subkeys. Note + * that k[i] corresponds to what the Twofish paper calls K[i+8]. */ +typedef struct { + u_int32_t s[4][256], w[8], k[32]; +} TWOFISH_context; + +typedef TWOFISH_context twofish_context; +int twofish_set_key(twofish_context *tf_ctx, const u_int8_t * in_key, int key_len); +int twofish_encrypt(twofish_context *tf_ctx, const u_int8_t * in, u_int8_t * out); +int twofish_decrypt(twofish_context * tf_ctx, const u_int8_t * in, u_int8_t * out); +#endif /* TWOFISH_H */ -- cgit v1.2.3