PolarSSL v1.2.12
camellia.h
Go to the documentation of this file.
1 
27 #ifndef POLARSSL_CAMELLIA_H
28 #define POLARSSL_CAMELLIA_H
29 
30 #include "config.h"
31 
32 #include <string.h>
33 
34 #ifdef _MSC_VER
35 #include <basetsd.h>
36 typedef UINT32 uint32_t;
37 #else
38 #include <inttypes.h>
39 #endif
40 
41 #define CAMELLIA_ENCRYPT 1
42 #define CAMELLIA_DECRYPT 0
43 
44 #define POLARSSL_ERR_CAMELLIA_INVALID_KEY_LENGTH -0x0024
45 #define POLARSSL_ERR_CAMELLIA_INVALID_INPUT_LENGTH -0x0026
47 #if !defined(POLARSSL_CAMELLIA_ALT)
48 // Regular implementation
49 //
50 
54 typedef struct
55 {
56  int nr;
57  uint32_t rk[68];
58 }
60 
61 #ifdef __cplusplus
62 extern "C" {
63 #endif
64 
74 int camellia_setkey_enc( camellia_context *ctx, const unsigned char *key, unsigned int keysize );
75 
85 int camellia_setkey_dec( camellia_context *ctx, const unsigned char *key, unsigned int keysize );
86 
98  int mode,
99  const unsigned char input[16],
100  unsigned char output[16] );
101 
117  int mode,
118  size_t length,
119  unsigned char iv[16],
120  const unsigned char *input,
121  unsigned char *output );
122 
141  int mode,
142  size_t length,
143  size_t *iv_off,
144  unsigned char iv[16],
145  const unsigned char *input,
146  unsigned char *output );
147 
170  size_t length,
171  size_t *nc_off,
172  unsigned char nonce_counter[16],
173  unsigned char stream_block[16],
174  const unsigned char *input,
175  unsigned char *output );
176 
177 #ifdef __cplusplus
178 }
179 #endif
180 
181 #else /* POLARSSL_CAMELLIA_ALT */
182 #include "camellia_alt.h"
183 #endif /* POLARSSL_CAMELLIA_ALT */
184 
185 #ifdef __cplusplus
186 extern "C" {
187 #endif
188 
194 int camellia_self_test( int verbose );
195 
196 #ifdef __cplusplus
197 }
198 #endif
199 
200 #endif /* camellia.h */