1 | /* camellia.h ver 1.2.0
|
---|
2 | *
|
---|
3 | * Copyright (C) 2006,2007
|
---|
4 | * NTT (Nippon Telegraph and Telephone Corporation).
|
---|
5 | *
|
---|
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.
|
---|
10 | *
|
---|
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.
|
---|
15 | *
|
---|
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.
|
---|
19 | */
|
---|
20 |
|
---|
21 | #ifndef HEADER_CAMELLIA_H
|
---|
22 | #define HEADER_CAMELLIA_H
|
---|
23 |
|
---|
24 | #ifdef __cplusplus
|
---|
25 | extern "C" {
|
---|
26 | #endif
|
---|
27 |
|
---|
28 | #define CAMELLIA_BLOCK_SIZE 16
|
---|
29 | #define CAMELLIA_TABLE_BYTE_LEN 272
|
---|
30 | #define CAMELLIA_TABLE_WORD_LEN (CAMELLIA_TABLE_BYTE_LEN / 4)
|
---|
31 |
|
---|
32 | /* u32 must be 32bit word */
|
---|
33 | typedef uint32_t u32;
|
---|
34 | typedef unsigned char u8;
|
---|
35 |
|
---|
36 | typedef u32 KEY_TABLE_TYPE[CAMELLIA_TABLE_WORD_LEN];
|
---|
37 |
|
---|
38 |
|
---|
39 | void Camellia_Ekeygen(const int keyBitLength,
|
---|
40 | const unsigned char *rawKey,
|
---|
41 | KEY_TABLE_TYPE keyTable);
|
---|
42 |
|
---|
43 | void Camellia_EncryptBlock(const int keyBitLength,
|
---|
44 | const unsigned char *plaintext,
|
---|
45 | const KEY_TABLE_TYPE keyTable,
|
---|
46 | unsigned char *cipherText);
|
---|
47 |
|
---|
48 | void Camellia_DecryptBlock(const int keyBitLength,
|
---|
49 | const unsigned char *cipherText,
|
---|
50 | const KEY_TABLE_TYPE keyTable,
|
---|
51 | unsigned char *plaintext);
|
---|
52 |
|
---|
53 |
|
---|
54 | #ifdef __cplusplus
|
---|
55 | }
|
---|
56 | #endif
|
---|
57 |
|
---|
58 | #endif /* HEADER_CAMELLIA_H */
|
---|