cleaned up pluto's crypto framework
[strongswan.git] / src / pluto / alg / ike_alg_twofish.c
1 #include <stdio.h>
2 #include <string.h>
3 #include <stddef.h>
4 #include <sys/types.h>
5 #include <freeswan.h>
6
7 #include "constants.h"
8 #include "defs.h"
9 #include "log.h"
10 #include "libtwofish/twofish_cbc.h"
11 #include "alg_info.h"
12 #include "ike_alg.h"
13
14 #define TWOFISH_KEY_MIN_LEN 128
15 #define TWOFISH_KEY_DEF_LEN 128
16 #define TWOFISH_KEY_MAX_LEN 256
17
18 struct encrypt_desc encrypt_desc_twofish =
19 {
20 algo_type: IKE_ALG_ENCRYPT,
21 algo_id: OAKLEY_TWOFISH_CBC,
22 algo_next: NULL,
23
24 enc_blocksize: TWOFISH_BLOCK_SIZE,
25 keydeflen: TWOFISH_KEY_MIN_LEN,
26 keyminlen: TWOFISH_KEY_DEF_LEN,
27 keymaxlen: TWOFISH_KEY_MAX_LEN,
28 enc_testvectors: NULL
29 };
30
31 struct encrypt_desc encrypt_desc_twofish_ssh =
32 {
33 algo_type: IKE_ALG_ENCRYPT,
34 algo_id: OAKLEY_TWOFISH_CBC_SSH,
35 algo_next: NULL,
36
37 enc_blocksize: TWOFISH_BLOCK_SIZE,
38 keydeflen: TWOFISH_KEY_MIN_LEN,
39 keyminlen: TWOFISH_KEY_DEF_LEN,
40 keymaxlen: TWOFISH_KEY_MAX_LEN,
41 enc_testvectors: NULL
42 };
43
44 int ike_alg_twofish_init(void);
45
46 int
47 ike_alg_twofish_init(void)
48 {
49 int ret = ike_alg_register_enc(&encrypt_desc_twofish);
50
51 if (ike_alg_register_enc(&encrypt_desc_twofish_ssh) < 0)
52 plog("ike_alg_twofish_init(): Experimental OAKLEY_TWOFISH_CBC_SSH activation failed");
53
54 return ret;
55 }
56 /*
57 IKE_ALG_INIT_NAME: ike_alg_twofish_init
58 */