3 The arctwo/rfc2268 block cipher.
5 Copyright (C) 2004 Simon Josefsson
6 Copyright (C) 2002, 2004, 2014 Niels Möller
8 This file is part of GNU Nettle.
10 GNU Nettle is free software: you can redistribute it and/or
11 modify it under the terms of either:
13 * the GNU Lesser General Public License as published by the Free
14 Software Foundation; either version 3 of the License, or (at your
15 option) any later version.
19 * the GNU General Public License as published by the Free
20 Software Foundation; either version 2 of the License, or (at your
21 option) any later version.
23 or both in parallel, as here.
25 GNU Nettle is distributed in the hope that it will be useful,
26 but WITHOUT ANY WARRANTY; without even the implied warranty of
27 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28 General Public License for more details.
30 You should have received copies of the GNU General Public License and
31 the GNU Lesser General Public License along with this program. If
32 not, see http://www.gnu.org/licenses/.
35 #ifndef NETTLE_ARCTWO_H_INCLUDED
36 #define NETTLE_ARCTWO_H_INCLUDED
38 #include "nettle-types.h"
45 #define arctwo_set_key nettle_arctwo_set_key
46 #define arctwo_set_key_ekb nettle_arctwo_set_key_ekb
47 #define arctwo_set_key_gutmann nettle_arctwo_set_key_gutmann
48 #define arctwo40_set_key nettle_arctwo40_set_key
49 #define arctwo64_set_key nettle_arctwo64_set_key
50 #define arctwo128_set_key nettle_arctwo128_set_key
51 #define arctwo128_set_key_gutmann nettle_arctwo128_set_key_gutmann
52 #define arctwo_encrypt nettle_arctwo_encrypt
53 #define arctwo_decrypt nettle_arctwo_decrypt
55 #define ARCTWO_BLOCK_SIZE 8
57 /* Variable key size from 1 byte to 128 bytes. */
58 #define ARCTWO_MIN_KEY_SIZE 1
59 #define ARCTWO_MAX_KEY_SIZE 128
61 #define ARCTWO_KEY_SIZE 8
68 /* Key expansion function that takes the "effective key bits", 1-1024,
69 as an explicit argument. 0 means maximum key bits. */
71 arctwo_set_key_ekb (struct arctwo_ctx *ctx,
72 size_t length, const uint8_t * key, unsigned ekb);
74 /* Equvivalent to arctwo_set_key_ekb, with ekb = 8 * length */
76 arctwo_set_key (struct arctwo_ctx *ctx, size_t length, const uint8_t *key);
78 arctwo40_set_key (struct arctwo_ctx *ctx, const uint8_t *key);
80 arctwo64_set_key (struct arctwo_ctx *ctx, const uint8_t *key);
82 arctwo128_set_key (struct arctwo_ctx *ctx, const uint8_t *key);
84 /* Equvivalent to arctwo_set_key_ekb, with ekb = 1024 */
86 arctwo_set_key_gutmann (struct arctwo_ctx *ctx,
87 size_t length, const uint8_t *key);
89 arctwo128_set_key_gutmann (struct arctwo_ctx *ctx,
93 arctwo_encrypt (struct arctwo_ctx *ctx,
94 size_t length, uint8_t *dst, const uint8_t *src);
96 arctwo_decrypt (struct arctwo_ctx *ctx,
97 size_t length, uint8_t *dst, const uint8_t *src);
103 #endif /* NETTLE_ARCTWO_H_INCLUDED */