2N/A/* camellia.h ver 1.2.0
2N/A *
2N/A * Copyright (C) 2006,2007
2N/A * NTT (Nippon Telegraph and Telephone Corporation).
2N/A *
2N/A * This library is free software; you can redistribute it and/or
2N/A * modify it under the terms of the GNU Lesser General Public
2N/A * License as published by the Free Software Foundation; either
2N/A * version 2.1 of the License, or (at your option) any later version.
2N/A *
2N/A * This library is distributed in the hope that it will be useful,
2N/A * but WITHOUT ANY WARRANTY; without even the implied warranty of
2N/A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2N/A * Lesser General Public License for more details.
2N/A *
2N/A * You should have received a copy of the GNU Lesser General Public
2N/A * License along with this library; if not, write to the Free Software
2N/A * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2N/A */
2N/A
2N/A#ifndef HEADER_CAMELLIA_H
2N/A#define HEADER_CAMELLIA_H
2N/A
2N/A/* To use Camellia with libraries it is often useful to keep the name
2N/A * space of the library clean. The following macro is thus useful:
2N/A *
2N/A * #define CAMELLIA_EXT_SYM_PREFIX foo_
2N/A *
2N/A * This prefixes all external symbols with "foo_".
2N/A */
2N/A#ifdef HAVE_CONFIG_H
2N/A#include <config.h>
2N/A#endif
2N/A#ifdef CAMELLIA_EXT_SYM_PREFIX
2N/A#define CAMELLIA_PREFIX1(x,y) x ## y
2N/A#define CAMELLIA_PREFIX2(x,y) CAMELLIA_PREFIX1(x,y)
2N/A#define CAMELLIA_PREFIX(x) CAMELLIA_PREFIX2(CAMELLIA_EXT_SYM_PREFIX,x)
2N/A#define Camellia_Ekeygen CAMELLIA_PREFIX(Camellia_Ekeygen)
2N/A#define Camellia_EncryptBlock CAMELLIA_PREFIX(Camellia_EncryptBlock)
2N/A#define Camellia_DecryptBlock CAMELLIA_PREFIX(Camellia_DecryptBlock)
2N/A#define camellia_decrypt128 CAMELLIA_PREFIX(camellia_decrypt128)
2N/A#define camellia_decrypt256 CAMELLIA_PREFIX(camellia_decrypt256)
2N/A#define camellia_encrypt128 CAMELLIA_PREFIX(camellia_encrypt128)
2N/A#define camellia_encrypt256 CAMELLIA_PREFIX(camellia_encrypt256)
2N/A#define camellia_setup128 CAMELLIA_PREFIX(camellia_setup128)
2N/A#define camellia_setup192 CAMELLIA_PREFIX(camellia_setup192)
2N/A#define camellia_setup256 CAMELLIA_PREFIX(camellia_setup256)
2N/A#endif /*CAMELLIA_EXT_SYM_PREFIX*/
2N/A
2N/A
2N/A#ifdef __cplusplus
2N/Aextern "C" {
2N/A#endif
2N/A
2N/A#define CAMELLIA_BLOCK_SIZE 16
2N/A#define CAMELLIA_TABLE_BYTE_LEN 272
2N/A#define CAMELLIA_TABLE_WORD_LEN (CAMELLIA_TABLE_BYTE_LEN / 4)
2N/A
2N/Atypedef unsigned int KEY_TABLE_TYPE[CAMELLIA_TABLE_WORD_LEN];
2N/A
2N/A
2N/Avoid Camellia_Ekeygen(const int keyBitLength,
2N/A const unsigned char *rawKey,
2N/A KEY_TABLE_TYPE keyTable);
2N/A
2N/Avoid Camellia_EncryptBlock(const int keyBitLength,
2N/A const unsigned char *plaintext,
2N/A const KEY_TABLE_TYPE keyTable,
2N/A unsigned char *cipherText);
2N/A
2N/Avoid Camellia_DecryptBlock(const int keyBitLength,
2N/A const unsigned char *cipherText,
2N/A const KEY_TABLE_TYPE keyTable,
2N/A unsigned char *plaintext);
2N/A
2N/A
2N/A#ifdef __cplusplus
2N/A}
2N/A#endif
2N/A
2N/A#endif /* HEADER_CAMELLIA_H */