[MBEDTLS] Use mbedtls as a lightweight schannel TLS/SSL back-end. This is an initial...
[reactos.git] / reactos / include / reactos / libs / gnutls / nettle / cast128.h
1 /* cast128.h
2 *
3 * The CAST-128 block cipher.
4 */
5
6 /* CAST-128 in C
7 * Written by Steve Reid <sreid@sea-to-sky.net>
8 * 100% Public Domain - no warranty
9 * Released 1997.10.11
10 */
11
12 /* nettle, low-level cryptographics library
13 *
14 * Copyright (C) 2001 Niels Möller
15 *
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.
20 *
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.
25 *
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,
29 * MA 02111-1301, USA.
30 */
31
32 #ifndef NETTLE_CAST128_H_INCLUDED
33 #define NETTLE_CAST128_H_INCLUDED
34
35 #include "nettle-types.h"
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40
41 /* Name mangling */
42 #define cast128_set_key nettle_cast128_set_key
43 #define cast128_encrypt nettle_cast128_encrypt
44 #define cast128_decrypt nettle_cast128_decrypt
45
46 #define CAST128_BLOCK_SIZE 8
47
48 /* Variable key size between 40 and 128. */
49 #define CAST128_MIN_KEY_SIZE 5
50 #define CAST128_MAX_KEY_SIZE 16
51
52 #define CAST128_KEY_SIZE 16
53
54 struct cast128_ctx {
55 uint32_t keys[32]; /* Key, after expansion */
56 unsigned rounds; /* Number of rounds to use, 12 or 16 */
57 };
58
59 void
60 cast128_set_key(struct cast128_ctx *ctx,
61 unsigned length, const uint8_t * key);
62
63 void
64 cast128_encrypt(const struct cast128_ctx *ctx,
65 unsigned length, uint8_t * dst,
66 const uint8_t * src);
67 void
68 cast128_decrypt(const struct cast128_ctx *ctx,
69 unsigned length, uint8_t * dst,
70 const uint8_t * src);
71
72 #ifdef __cplusplus
73 }
74 #endif
75 #endif /* NETTLE_CAST128_H_INCLUDED */