| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #ifndef NETTLE_CAMELLIA_H_INCLUDED |
| #define NETTLE_CAMELLIA_H_INCLUDED |
|
|
| #include "nettle-types.h" |
|
|
| #ifdef __cplusplus |
| extern "C" { |
| #endif |
|
|
| |
| #define camellia128_set_encrypt_key nettle_camellia128_set_encrypt_key |
| #define camellia128_set_decrypt_key nettle_camellia_set_decrypt_key |
| #define camellia128_invert_key nettle_camellia128_invert_key |
| #define camellia128_crypt nettle_camellia128_crypt |
|
|
| #define camellia192_set_encrypt_key nettle_camellia192_set_encrypt_key |
| #define camellia192_set_decrypt_key nettle_camellia192_set_decrypt_key |
|
|
| #define camellia256_set_encrypt_key nettle_camellia256_set_encrypt_key |
| #define camellia256_set_decrypt_key nettle_camellia256_set_decrypt_key |
| #define camellia256_invert_key nettle_camellia256_invert_key |
| #define camellia256_crypt nettle_camellia256_crypt |
|
|
|
|
| #define CAMELLIA_BLOCK_SIZE 16 |
| |
| #define CAMELLIA128_KEY_SIZE 16 |
| #define CAMELLIA192_KEY_SIZE 24 |
| #define CAMELLIA256_KEY_SIZE 32 |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #define _CAMELLIA128_NKEYS 24 |
| #define _CAMELLIA256_NKEYS 32 |
|
|
| struct camellia128_ctx |
| { |
| uint64_t keys[_CAMELLIA128_NKEYS]; |
| }; |
|
|
| void |
| camellia128_set_encrypt_key(struct camellia128_ctx *ctx, |
| const uint8_t *key); |
|
|
| void |
| camellia128_set_decrypt_key(struct camellia128_ctx *ctx, |
| const uint8_t *key); |
|
|
| void |
| camellia128_invert_key(struct camellia128_ctx *dst, |
| const struct camellia128_ctx *src); |
|
|
| void |
| camellia128_crypt(const struct camellia128_ctx *ctx, |
| size_t length, uint8_t *dst, |
| const uint8_t *src); |
|
|
| struct camellia256_ctx |
| { |
| uint64_t keys[_CAMELLIA256_NKEYS]; |
| }; |
|
|
| void |
| camellia256_set_encrypt_key(struct camellia256_ctx *ctx, |
| const uint8_t *key); |
|
|
| void |
| camellia256_set_decrypt_key(struct camellia256_ctx *ctx, |
| const uint8_t *key); |
|
|
| void |
| camellia256_invert_key(struct camellia256_ctx *dst, |
| const struct camellia256_ctx *src); |
|
|
| void |
| camellia256_crypt(const struct camellia256_ctx *ctx, |
| size_t length, uint8_t *dst, |
| const uint8_t *src); |
|
|
| |
| |
| |
| |
| #define camellia192_ctx camellia256_ctx |
|
|
| void |
| camellia192_set_encrypt_key(struct camellia256_ctx *ctx, |
| const uint8_t *key); |
|
|
| void |
| camellia192_set_decrypt_key(struct camellia256_ctx *ctx, |
| const uint8_t *key); |
|
|
| #define camellia192_invert_key camellia256_invert_key |
| #define camellia192_crypt camellia256_crypt |
|
|
| #ifdef __cplusplus |
| } |
| #endif |
|
|
| #endif |
|
|