]> git.ipfire.org Git - people/ms/strongswan.git/blob - src/libfreeswan/libcrypto/libtwofish/twofish.h
- started to rebuild source layout
[people/ms/strongswan.git] / src / libfreeswan / libcrypto / libtwofish / twofish.h
1 #ifndef TWOFISH_H
2 #define TWOFISH_H
3 #ifdef __KERNEL__
4 #include <linux/types.h>
5 #else
6 #include <sys/types.h>
7 #endif
8 /* Structure for an expanded Twofish key. s contains the key-dependent
9 * S-boxes composed with the MDS matrix; w contains the eight "whitening"
10 * subkeys, K[0] through K[7]. k holds the remaining, "round" subkeys. Note
11 * that k[i] corresponds to what the Twofish paper calls K[i+8]. */
12 typedef struct {
13 u_int32_t s[4][256], w[8], k[32];
14 } TWOFISH_context;
15
16 typedef TWOFISH_context twofish_context;
17 int twofish_set_key(twofish_context *tf_ctx, const u_int8_t * in_key, int key_len);
18 int twofish_encrypt(twofish_context *tf_ctx, const u_int8_t * in, u_int8_t * out);
19 int twofish_decrypt(twofish_context * tf_ctx, const u_int8_t * in, u_int8_t * out);
20 #endif /* TWOFISH_H */