Correct PPTP server firewall rules chain.
[tomato/davidwu.git] / release / src / router / nettle / arctwo.h
blob6f763bb95b865728e476c355fe8a737ba322018a
1 /* arctwo.h
3 * The arctwo/rfc2268 block cipher.
4 */
6 /* nettle, low-level cryptographics library
8 * Copyright (C) 2004 Simon Josefsson
9 * Copyright (C) 2002, 2004 Niels Möller
11 * The nettle library is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License as published by
13 * the Free Software Foundation; either version 2.1 of the License, or (at your
14 * option) any later version.
16 * The nettle library is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
18 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
19 * License for more details.
21 * You should have received a copy of the GNU Lesser General Public License
22 * along with the nettle library; see the file COPYING.LIB. If not, write to
23 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
24 * MA 02111-1301, USA.
27 #ifndef NETTLE_ARCTWO_H_INCLUDED
28 #define NETTLE_ARCTWO_H_INCLUDED
30 #include "nettle-types.h"
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
36 /* Name mangling */
37 #define arctwo_set_key nettle_arctwo_set_key
38 #define arctwo_set_key_ekb nettle_arctwo_set_key_ekb
39 #define arctwo_encrypt nettle_arctwo_encrypt
40 #define arctwo_decrypt nettle_arctwo_decrypt
41 #define arctwo_set_key_gutmann nettle_arctwo_set_key_gutmann
43 #define ARCTWO_BLOCK_SIZE 8
45 /* Variable key size from 1 byte to 128 bytes. */
46 #define ARCTWO_MIN_KEY_SIZE 1
47 #define ARCTWO_MAX_KEY_SIZE 128
49 #define ARCTWO_KEY_SIZE 8
51 struct arctwo_ctx
53 uint16_t S[64];
56 /* Key expansion function that takes the "effective key bits", 1-1024,
57 as an explicit argument. 0 means maximum key bits. */
58 void
59 arctwo_set_key_ekb (struct arctwo_ctx *ctx,
60 unsigned length, const uint8_t * key, unsigned ekb);
62 /* Equvivalent to arctwo_set_key_ekb, with ekb = 8 * length */
63 void
64 arctwo_set_key (struct arctwo_ctx *ctx, unsigned length, const uint8_t *key);
66 /* Equvivalent to arctwo_set_key_ekb, with ekb = 1024 */
67 void
68 arctwo_set_key_gutmann (struct arctwo_ctx *ctx,
69 unsigned length, const uint8_t *key);
71 void
72 arctwo_encrypt (struct arctwo_ctx *ctx,
73 unsigned length, uint8_t *dst, const uint8_t *src);
74 void
75 arctwo_decrypt (struct arctwo_ctx *ctx,
76 unsigned length, uint8_t *dst, const uint8_t *src);
78 #ifdef __cplusplus
80 #endif
82 #endif /* NETTLE_ARCTWO_H_INCLUDED */