00001
00021 #ifndef POLARSSL_CAMELLIA_H
00022 #define POLARSSL_CAMELLIA_H
00023
00024 #ifdef _MSC_VER
00025 #include <basetsd.h>
00026 typedef UINT32 uint32_t;
00027 #else
00028 #include <inttypes.h>
00029 #endif
00030
00031 #define CAMELLIA_ENCRYPT 1
00032 #define CAMELLIA_DECRYPT 0
00033
00034 #define POLARSSL_ERR_CAMELLIA_INVALID_KEY_LENGTH -0x0a00
00035
00039 typedef struct
00040 {
00041 int nr;
00042 uint32_t rk[68];
00043 }
00044 camellia_context;
00045
00046 #ifdef __cplusplus
00047 extern "C" {
00048 #endif
00049
00059 int camellia_setkey_enc( camellia_context *ctx, unsigned char *key, int keysize );
00060
00070 int camellia_setkey_dec( camellia_context *ctx, unsigned char *key, int keysize );
00071
00080 void camellia_crypt_ecb( camellia_context *ctx,
00081 int mode,
00082 unsigned char input[16],
00083 unsigned char output[16] );
00084
00097 void camellia_crypt_cbc( camellia_context *ctx,
00098 int mode,
00099 int length,
00100 unsigned char iv[16],
00101 unsigned char *input,
00102 unsigned char *output );
00103
00115 void camellia_crypt_cfb128( camellia_context *ctx,
00116 int mode,
00117 int length,
00118 int *iv_off,
00119 unsigned char iv[16],
00120 unsigned char *input,
00121 unsigned char *output );
00122
00128 int camellia_self_test( int verbose );
00129
00130 #ifdef __cplusplus
00131 }
00132 #endif
00133
00134 #endif