123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235 |
- #ifndef MBEDTLS_CAMELLIA_H
- #define MBEDTLS_CAMELLIA_H
- #if !defined(MBEDTLS_CONFIG_FILE)
- #include "config.h"
- #else
- #include MBEDTLS_CONFIG_FILE
- #endif
- #include <stddef.h>
- #include <stdint.h>
- #define MBEDTLS_CAMELLIA_ENCRYPT 1
- #define MBEDTLS_CAMELLIA_DECRYPT 0
- #define MBEDTLS_ERR_CAMELLIA_INVALID_KEY_LENGTH -0x0024
- #define MBEDTLS_ERR_CAMELLIA_INVALID_INPUT_LENGTH -0x0026
- #if !defined(MBEDTLS_CAMELLIA_ALT)
- #ifdef __cplusplus
- extern "C" {
- #endif
- typedef struct
- {
- int nr;
- uint32_t rk[68];
- }
- mbedtls_camellia_context;
- void mbedtls_camellia_init( mbedtls_camellia_context *ctx );
- void mbedtls_camellia_free( mbedtls_camellia_context *ctx );
- int mbedtls_camellia_setkey_enc( mbedtls_camellia_context *ctx, const unsigned char *key,
- unsigned int keybits );
- int mbedtls_camellia_setkey_dec( mbedtls_camellia_context *ctx, const unsigned char *key,
- unsigned int keybits );
- int mbedtls_camellia_crypt_ecb( mbedtls_camellia_context *ctx,
- int mode,
- const unsigned char input[16],
- unsigned char output[16] );
- #if defined(MBEDTLS_CIPHER_MODE_CBC)
- 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 );
- #endif
- #if defined(MBEDTLS_CIPHER_MODE_CFB)
- 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 );
- #endif
- #if defined(MBEDTLS_CIPHER_MODE_CTR)
- 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 );
- #endif
- #ifdef __cplusplus
- }
- #endif
- #else
- #include "camellia_alt.h"
- #endif
- #ifdef __cplusplus
- extern "C" {
- #endif
- int mbedtls_camellia_self_test( int verbose );
- #ifdef __cplusplus
- }
- #endif
- #endif
|