GRUB-1.98 changes
[grub2/jjazz.git] / lib / libgcrypt-grub / cipher / camellia.h
blob334602194d9285005a52537a6096b92ad8a05c01
1 /* This file was automatically imported with
2 import_gcry.py. Please don't modify it */
3 /* camellia.h ver 1.2.0
5 * Copyright (C) 2006,2007
6 * NTT (Nippon Telegraph and Telephone Corporation).
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 #ifndef HEADER_CAMELLIA_H
24 #define HEADER_CAMELLIA_H
26 /* To use Camellia with libraries it is often useful to keep the name
27 * space of the library clean. The following macro is thus useful:
29 * #define CAMELLIA_EXT_SYM_PREFIX foo_
31 * This prefixes all external symbols with "foo_".
33 #ifdef HAVE_CONFIG_H
34 #endif
35 #ifdef CAMELLIA_EXT_SYM_PREFIX
36 #define CAMELLIA_PREFIX1(x,y) x ## y
37 #define CAMELLIA_PREFIX2(x,y) CAMELLIA_PREFIX1(x,y)
38 #define CAMELLIA_PREFIX(x) CAMELLIA_PREFIX2(CAMELLIA_EXT_SYM_PREFIX,x)
39 #define Camellia_Ekeygen CAMELLIA_PREFIX(Camellia_Ekeygen)
40 #define Camellia_EncryptBlock CAMELLIA_PREFIX(Camellia_EncryptBlock)
41 #define Camellia_DecryptBlock CAMELLIA_PREFIX(Camellia_DecryptBlock)
42 #define camellia_decrypt128 CAMELLIA_PREFIX(camellia_decrypt128)
43 #define camellia_decrypt256 CAMELLIA_PREFIX(camellia_decrypt256)
44 #define camellia_encrypt128 CAMELLIA_PREFIX(camellia_encrypt128)
45 #define camellia_encrypt256 CAMELLIA_PREFIX(camellia_encrypt256)
46 #define camellia_setup128 CAMELLIA_PREFIX(camellia_setup128)
47 #define camellia_setup192 CAMELLIA_PREFIX(camellia_setup192)
48 #define camellia_setup256 CAMELLIA_PREFIX(camellia_setup256)
49 #endif /*CAMELLIA_EXT_SYM_PREFIX*/
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
56 #define CAMELLIA_BLOCK_SIZE 16
57 #define CAMELLIA_TABLE_BYTE_LEN 272
58 #define CAMELLIA_TABLE_WORD_LEN (CAMELLIA_TABLE_BYTE_LEN / 4)
60 typedef unsigned int KEY_TABLE_TYPE[CAMELLIA_TABLE_WORD_LEN];
63 void Camellia_Ekeygen(const int keyBitLength,
64 const unsigned char *rawKey,
65 KEY_TABLE_TYPE keyTable);
67 void Camellia_EncryptBlock(const int keyBitLength,
68 const unsigned char *plaintext,
69 const KEY_TABLE_TYPE keyTable,
70 unsigned char *cipherText);
72 void Camellia_DecryptBlock(const int keyBitLength,
73 const unsigned char *cipherText,
74 const KEY_TABLE_TYPE keyTable,
75 unsigned char *plaintext);
78 #ifdef __cplusplus
80 #endif
82 #endif /* HEADER_CAMELLIA_H */