Correct PPTP server firewall rules chain.
[tomato/davidwu.git] / release / src / router / nettle / twofish.h
blob11e73a26c4b2bc4a509263a44cf0e5cd02cee309
1 /* twofish.h
3 * The twofish block cipher.
4 */
6 /* nettle, low-level cryptographics library
8 * Copyright (C) 2001 Niels Möller
9 *
10 * The nettle library is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU Lesser General Public License as published by
12 * the Free Software Foundation; either version 2.1 of the License, or (at your
13 * option) any later version.
15 * The nettle library is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18 * License for more details.
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with the nettle library; see the file COPYING.LIB. If not, write to
22 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
23 * MA 02111-1301, USA.
27 * Twofish is a 128-bit block cipher that accepts a variable-length
28 * key up to 256 bits, designed by Bruce Schneier and others. See
29 * http://www.counterpane.com/twofish.html for details.
32 #ifndef NETTLE_TWOFISH_H_INCLUDED
33 #define NETTLE_TWOFISH_H_INCLUDED
35 #include "nettle-types.h"
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
41 /* Name mangling */
42 #define twofish_set_key nettle_twofish_set_key
43 #define twofish_encrypt nettle_twofish_encrypt
44 #define twofish_decrypt nettle_twofish_decrypt
46 #define TWOFISH_BLOCK_SIZE 16
48 /* Variable key size between 128 and 256 bits. But the only valid
49 * values are 16 (128 bits), 24 (192 bits) and 32 (256 bits). */
50 #define TWOFISH_MIN_KEY_SIZE 16
51 #define TWOFISH_MAX_KEY_SIZE 32
53 #define TWOFISH_KEY_SIZE 32
55 struct twofish_ctx
57 uint32_t keys[40];
58 uint32_t s_box[4][256];
61 void
62 twofish_set_key(struct twofish_ctx *ctx,
63 unsigned length, const uint8_t *key);
65 void
66 twofish_encrypt(const struct twofish_ctx *ctx,
67 unsigned length, uint8_t *dst,
68 const uint8_t *src);
69 void
70 twofish_decrypt(const struct twofish_ctx *ctx,
71 unsigned length, uint8_t *dst,
72 const uint8_t *src);
74 #ifdef __cplusplus
76 #endif
78 #endif /* NETTLE_TWOFISH_H_INCLUDED */