1 /* This file was automatically imported with
2 import_gcry.py. Please don't modify it */
5 void camellia_setup128(const unsigned char *key
, grub_uint32_t
*subkey
);
6 void camellia_setup192(const unsigned char *key
, grub_uint32_t
*subkey
);
7 void camellia_setup256(const unsigned char *key
, grub_uint32_t
*subkey
);
8 void camellia_encrypt128(const grub_uint32_t
*subkey
, grub_uint32_t
*io
);
9 void camellia_encrypt192(const grub_uint32_t
*subkey
, grub_uint32_t
*io
);
10 void camellia_encrypt256(const grub_uint32_t
*subkey
, grub_uint32_t
*io
);
11 void camellia_decrypt128(const grub_uint32_t
*subkey
, grub_uint32_t
*io
);
12 void camellia_decrypt192(const grub_uint32_t
*subkey
, grub_uint32_t
*io
);
13 void camellia_decrypt256(const grub_uint32_t
*subkey
, grub_uint32_t
*io
);
14 #define memcpy grub_memcpy
15 /* camellia.h ver 1.2.0
17 * Copyright (C) 2006,2007
18 * NTT (Nippon Telegraph and Telephone Corporation).
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Lesser General Public
22 * License as published by the Free Software Foundation; either
23 * version 2.1 of the License, or (at your option) any later version.
25 * This library 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 * Lesser General Public License for more details.
30 * You should have received a copy of the GNU Lesser General Public
31 * License along with this library; if not, write to the Free Software
32 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
35 #ifndef HEADER_CAMELLIA_H
36 #define HEADER_CAMELLIA_H
38 /* To use Camellia with libraries it is often useful to keep the name
39 * space of the library clean. The following macro is thus useful:
41 * #define CAMELLIA_EXT_SYM_PREFIX foo_
43 * This prefixes all external symbols with "foo_".
47 #ifdef CAMELLIA_EXT_SYM_PREFIX
48 #define CAMELLIA_PREFIX1(x,y) x ## y
49 #define CAMELLIA_PREFIX2(x,y) CAMELLIA_PREFIX1(x,y)
50 #define CAMELLIA_PREFIX(x) CAMELLIA_PREFIX2(CAMELLIA_EXT_SYM_PREFIX,x)
51 #define Camellia_Ekeygen CAMELLIA_PREFIX(Camellia_Ekeygen)
52 #define Camellia_EncryptBlock CAMELLIA_PREFIX(Camellia_EncryptBlock)
53 #define Camellia_DecryptBlock CAMELLIA_PREFIX(Camellia_DecryptBlock)
54 #define camellia_decrypt128 CAMELLIA_PREFIX(camellia_decrypt128)
55 #define camellia_decrypt256 CAMELLIA_PREFIX(camellia_decrypt256)
56 #define camellia_encrypt128 CAMELLIA_PREFIX(camellia_encrypt128)
57 #define camellia_encrypt256 CAMELLIA_PREFIX(camellia_encrypt256)
58 #define camellia_setup128 CAMELLIA_PREFIX(camellia_setup128)
59 #define camellia_setup192 CAMELLIA_PREFIX(camellia_setup192)
60 #define camellia_setup256 CAMELLIA_PREFIX(camellia_setup256)
61 #endif /*CAMELLIA_EXT_SYM_PREFIX*/
68 #define CAMELLIA_BLOCK_SIZE 16
69 #define CAMELLIA_TABLE_BYTE_LEN 272
70 #define CAMELLIA_TABLE_WORD_LEN (CAMELLIA_TABLE_BYTE_LEN / 4)
72 typedef unsigned int KEY_TABLE_TYPE
[CAMELLIA_TABLE_WORD_LEN
];
75 void Camellia_Ekeygen(const int keyBitLength
,
76 const unsigned char *rawKey
,
77 KEY_TABLE_TYPE keyTable
);
79 void Camellia_EncryptBlock(const int keyBitLength
,
80 const unsigned char *plaintext
,
81 const KEY_TABLE_TYPE keyTable
,
82 unsigned char *cipherText
);
84 void Camellia_DecryptBlock(const int keyBitLength
,
85 const unsigned char *cipherText
,
86 const KEY_TABLE_TYPE keyTable
,
87 unsigned char *plaintext
);
94 #endif /* HEADER_CAMELLIA_H */