1 /* camellia.h ver 1.2.0
3 * Copyright (C) 2006,2007
4 * NTT (Nippon Telegraph and Telephone Corporation).
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 #ifndef HEADER_CAMELLIA_H
22 #define HEADER_CAMELLIA_H
28 #define CAMELLIA_BLOCK_SIZE 16
29 #define CAMELLIA_TABLE_BYTE_LEN 272
30 #define CAMELLIA_TABLE_WORD_LEN (CAMELLIA_TABLE_BYTE_LEN / 4)
32 /* u32 must be 32bit word */
34 typedef unsigned char u8
;
36 typedef u32 KEY_TABLE_TYPE
[CAMELLIA_TABLE_WORD_LEN
];
39 void Camellia_Ekeygen(const int keyBitLength
,
40 const unsigned char *rawKey
,
41 KEY_TABLE_TYPE keyTable
);
43 void Camellia_EncryptBlock(const int keyBitLength
,
44 const unsigned char *plaintext
,
45 const KEY_TABLE_TYPE keyTable
,
46 unsigned char *cipherText
);
48 void Camellia_DecryptBlock(const int keyBitLength
,
49 const unsigned char *cipherText
,
50 const KEY_TABLE_TYPE keyTable
,
51 unsigned char *plaintext
);
58 #endif /* HEADER_CAMELLIA_H */