3 * The CAST-128 block cipher.
7 * Written by Steve Reid <sreid@sea-to-sky.net>
8 * 100% Public Domain - no warranty
12 /* nettle, low-level cryptographics library
14 * Copyright (C) 2001 Niels Möller
16 * The nettle library is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU Lesser General Public License as published by
18 * the Free Software Foundation; either version 2.1 of the License, or (at your
19 * option) any later version.
21 * The nettle library is distributed in the hope that it will be useful, but
22 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
23 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
24 * License for more details.
26 * You should have received a copy of the GNU Lesser General Public License
27 * along with the nettle library; see the file COPYING.LIB. If not, write to
28 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
32 #ifndef NETTLE_CAST128_H_INCLUDED
33 #define NETTLE_CAST128_H_INCLUDED
35 #include "nettle-types.h"
42 #define cast128_set_key nettle_cast128_set_key
43 #define cast128_encrypt nettle_cast128_encrypt
44 #define cast128_decrypt nettle_cast128_decrypt
46 #define CAST128_BLOCK_SIZE 8
48 /* Variable key size between 40 and 128. */
49 #define CAST128_MIN_KEY_SIZE 5
50 #define CAST128_MAX_KEY_SIZE 16
52 #define CAST128_KEY_SIZE 16
56 uint32_t keys
[32]; /* Key, after expansion */
57 unsigned rounds
; /* Number of rounds to use, 12 or 16 */
61 cast128_set_key(struct cast128_ctx
*ctx
,
62 unsigned length
, const uint8_t *key
);
65 cast128_encrypt(const struct cast128_ctx
*ctx
,
66 unsigned length
, uint8_t *dst
,
69 cast128_decrypt(const struct cast128_ctx
*ctx
,
70 unsigned length
, uint8_t *dst
,
77 #endif /* NETTLE_CAST128_H_INCLUDED */