PolarSSL

polarssl/camellia.h

Go to the documentation of this file.
00001 
00025 #ifndef POLARSSL_CAMELLIA_H
00026 #define POLARSSL_CAMELLIA_H
00027 
00028 #ifdef _MSC_VER
00029 #include <basetsd.h>
00030 typedef UINT32 uint32_t;
00031 #else
00032 #include <inttypes.h>
00033 #endif
00034 
00035 #define CAMELLIA_ENCRYPT     1
00036 #define CAMELLIA_DECRYPT     0
00037 
00038 #define POLARSSL_ERR_CAMELLIA_INVALID_KEY_LENGTH            -0x0a00
00039 #define POLARSSL_ERR_CAMELLIA_INVALID_INPUT_LENGTH          -0x0a10
00040 
00044 typedef struct
00045 {
00046     int nr;                     
00047     uint32_t rk[68];            
00048 }
00049 camellia_context;
00050 
00051 #ifdef __cplusplus
00052 extern "C" {
00053 #endif
00054 
00064 int camellia_setkey_enc( camellia_context *ctx, const unsigned char *key, int keysize );
00065 
00075 int camellia_setkey_dec( camellia_context *ctx, const unsigned char *key, int keysize );
00076 
00087 int camellia_crypt_ecb( camellia_context *ctx,
00088                     int mode,
00089                     const unsigned char input[16],
00090                     unsigned char output[16] );
00091 
00106 int camellia_crypt_cbc( camellia_context *ctx,
00107                     int mode,
00108                     int length,
00109                     unsigned char iv[16],
00110                     const unsigned char *input,
00111                     unsigned char *output );
00112 
00126 int camellia_crypt_cfb128( camellia_context *ctx,
00127                        int mode,
00128                        int length,
00129                        int *iv_off,
00130                        unsigned char iv[16],
00131                        const unsigned char *input,
00132                        unsigned char *output );
00133 
00139 int camellia_self_test( int verbose );
00140 
00141 #ifdef __cplusplus
00142 }
00143 #endif
00144 
00145 #endif /* camellia.h */
 All Classes Files Functions Variables Defines