PolarSSL v1.2.7
camellia.h
Go to the documentation of this file.
1 
27 #ifndef POLARSSL_CAMELLIA_H
28 #define POLARSSL_CAMELLIA_H
29 
30 #include <string.h>
31 
32 #ifdef _MSC_VER
33 #include <basetsd.h>
34 typedef UINT32 uint32_t;
35 #else
36 #include <inttypes.h>
37 #endif
38 
39 #define CAMELLIA_ENCRYPT 1
40 #define CAMELLIA_DECRYPT 0
41 
42 #define POLARSSL_ERR_CAMELLIA_INVALID_KEY_LENGTH -0x0024
43 #define POLARSSL_ERR_CAMELLIA_INVALID_INPUT_LENGTH -0x0026
48 typedef struct
49 {
50  int nr;
51  uint32_t rk[68];
52 }
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58 
68 int camellia_setkey_enc( camellia_context *ctx, const unsigned char *key, unsigned int keysize );
69 
79 int camellia_setkey_dec( camellia_context *ctx, const unsigned char *key, unsigned int keysize );
80 
92  int mode,
93  const unsigned char input[16],
94  unsigned char output[16] );
95 
111  int mode,
112  size_t length,
113  unsigned char iv[16],
114  const unsigned char *input,
115  unsigned char *output );
116 
135  int mode,
136  size_t length,
137  size_t *iv_off,
138  unsigned char iv[16],
139  const unsigned char *input,
140  unsigned char *output );
141 
164  size_t length,
165  size_t *nc_off,
166  unsigned char nonce_counter[16],
167  unsigned char stream_block[16],
168  const unsigned char *input,
169  unsigned char *output );
170 
176 int camellia_self_test( int verbose );
177 
178 #ifdef __cplusplus
179 }
180 #endif
181 
182 #endif /* camellia.h */