22 #ifndef MBEDTLS_CAMELLIA_H
23 #define MBEDTLS_CAMELLIA_H
33 #define MBEDTLS_CAMELLIA_ENCRYPT 1
34 #define MBEDTLS_CAMELLIA_DECRYPT 0
37 #define MBEDTLS_ERR_CAMELLIA_BAD_INPUT_DATA -0x0024
40 #define MBEDTLS_ERR_CAMELLIA_INVALID_INPUT_LENGTH -0x0026
46 #if !defined(MBEDTLS_CAMELLIA_ALT)
53 typedef struct mbedtls_camellia_context
58 mbedtls_camellia_context;
61 #include "camellia_alt.h"
94 const unsigned char *key,
95 unsigned int keybits );
110 const unsigned char *key,
111 unsigned int keybits );
130 const unsigned char input[16],
131 unsigned char output[16] );
133 #if defined(MBEDTLS_CIPHER_MODE_CBC)
165 unsigned char iv[16],
166 const unsigned char *input,
167 unsigned char *output );
170 #if defined(MBEDTLS_CIPHER_MODE_CFB)
212 unsigned char iv[16],
213 const unsigned char *input,
214 unsigned char *output );
217 #if defined(MBEDTLS_CIPHER_MODE_CTR)
295 unsigned char nonce_counter[16],
296 unsigned char stream_block[16],
297 const unsigned char *input,
298 unsigned char *output );
301 #if defined(MBEDTLS_SELF_TEST)
int mbedtls_camellia_crypt_ecb(mbedtls_camellia_context *ctx, int mode, const unsigned char input[16], unsigned char output[16])
Perform a CAMELLIA-ECB block encryption/decryption operation.
int mbedtls_camellia_self_test(int verbose)
Checkup routine.
void mbedtls_camellia_free(mbedtls_camellia_context *ctx)
Clear a CAMELLIA context.
#define MBEDTLS_PRIVATE(member)
int mbedtls_camellia_crypt_cfb128(mbedtls_camellia_context *ctx, int mode, size_t length, size_t *iv_off, unsigned char iv[16], const unsigned char *input, unsigned char *output)
Perform a CAMELLIA-CFB128 buffer encryption/decryption operation.
int mbedtls_camellia_setkey_enc(mbedtls_camellia_context *ctx, const unsigned char *key, unsigned int keybits)
Perform a CAMELLIA key schedule operation for encryption.
Macro wrapper for struct's memebrs.
int mbedtls_camellia_setkey_dec(mbedtls_camellia_context *ctx, const unsigned char *key, unsigned int keybits)
Perform a CAMELLIA key schedule operation for decryption.
int mbedtls_camellia_crypt_ctr(mbedtls_camellia_context *ctx, size_t length, size_t *nc_off, unsigned char nonce_counter[16], unsigned char stream_block[16], const unsigned char *input, unsigned char *output)
Perform a CAMELLIA-CTR buffer encryption/decryption operation.
void mbedtls_camellia_init(mbedtls_camellia_context *ctx)
Initialize a CAMELLIA context.
Build-time configuration info.
int mbedtls_camellia_crypt_cbc(mbedtls_camellia_context *ctx, int mode, size_t length, unsigned char iv[16], const unsigned char *input, unsigned char *output)
Perform a CAMELLIA-CBC buffer encryption/decryption operation.