3 * The camellia block cipher.
6 /* Copyright (C) 2006,2007
7 * NTT (Nippon Telegraph and Telephone Corporation).
9 * Copyright (C) 2010 Niels Möller
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public
13 * License as published by the Free Software Foundation; either
14 * version 2.1 of the License, or (at your option) any later version.
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with this library; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
27 * Algorithm Specification
28 * http://info.isl.ntt.co.jp/crypt/eng/camellia/specifications.html
31 /* Based on camellia.c ver 1.2.0, see
32 http://info.isl.ntt.co.jp/crypt/eng/camellia/dl/camellia-LGPL-1.2.0.tar.gz.
35 #ifndef NETTLE_CAMELLIA_INTERNAL_H_INCLUDED
36 #define NETTLE_CAMELLIA_INTERNAL_H_INCLUDED
41 #define _camellia_crypt _nettle_camellia_crypt
42 #define _camellia_table _nettle_camellia_table
48 /* Rotation of 32-bit values. */
49 #define ROL32(bits, x) (((x) << (bits)) | ((x) >> (32 - (bits))))
51 /* Destructive rotation of 128 bit values. */
52 #define ROL128(bits, xl, xr) do { \
53 uint64_t __rol128_t = (xl); \
54 (xl) = ((xl) << (bits)) | ((xr) >> (64 - (bits))); \
55 (xr) = ((xr) << (bits)) | (__rol128_t >> (64 - (bits))); \
67 _camellia_crypt(const struct camellia_ctx *ctx,
68 const struct camellia_table *T,
69 unsigned length, uint8_t *dst,
72 extern const struct camellia_table _camellia_table;
74 #endif /* NETTLE_CAMELLIA_INTERNAL_H_INCLUDED */