File indexing completed on 2025-01-18 10:02:14
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035 #ifndef NETTLE_CAMELLIA_H_INCLUDED
0036 #define NETTLE_CAMELLIA_H_INCLUDED
0037
0038 #include "nettle-types.h"
0039
0040 #ifdef __cplusplus
0041 extern "C" {
0042 #endif
0043
0044
0045 #define camellia128_set_encrypt_key nettle_camellia128_set_encrypt_key
0046 #define camellia128_set_decrypt_key nettle_camellia_set_decrypt_key
0047 #define camellia128_invert_key nettle_camellia128_invert_key
0048 #define camellia128_crypt nettle_camellia128_crypt
0049
0050 #define camellia192_set_encrypt_key nettle_camellia192_set_encrypt_key
0051 #define camellia192_set_decrypt_key nettle_camellia192_set_decrypt_key
0052
0053 #define camellia256_set_encrypt_key nettle_camellia256_set_encrypt_key
0054 #define camellia256_set_decrypt_key nettle_camellia256_set_decrypt_key
0055 #define camellia256_invert_key nettle_camellia256_invert_key
0056 #define camellia256_crypt nettle_camellia256_crypt
0057
0058
0059 #define CAMELLIA_BLOCK_SIZE 16
0060
0061 #define CAMELLIA128_KEY_SIZE 16
0062 #define CAMELLIA192_KEY_SIZE 24
0063 #define CAMELLIA256_KEY_SIZE 32
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075 #define _CAMELLIA128_NKEYS 24
0076 #define _CAMELLIA256_NKEYS 32
0077
0078 struct camellia128_ctx
0079 {
0080 uint64_t keys[_CAMELLIA128_NKEYS];
0081 };
0082
0083 void
0084 camellia128_set_encrypt_key(struct camellia128_ctx *ctx,
0085 const uint8_t *key);
0086
0087 void
0088 camellia128_set_decrypt_key(struct camellia128_ctx *ctx,
0089 const uint8_t *key);
0090
0091 void
0092 camellia128_invert_key(struct camellia128_ctx *dst,
0093 const struct camellia128_ctx *src);
0094
0095 void
0096 camellia128_crypt(const struct camellia128_ctx *ctx,
0097 size_t length, uint8_t *dst,
0098 const uint8_t *src);
0099
0100 struct camellia256_ctx
0101 {
0102 uint64_t keys[_CAMELLIA256_NKEYS];
0103 };
0104
0105 void
0106 camellia256_set_encrypt_key(struct camellia256_ctx *ctx,
0107 const uint8_t *key);
0108
0109 void
0110 camellia256_set_decrypt_key(struct camellia256_ctx *ctx,
0111 const uint8_t *key);
0112
0113 void
0114 camellia256_invert_key(struct camellia256_ctx *dst,
0115 const struct camellia256_ctx *src);
0116
0117 void
0118 camellia256_crypt(const struct camellia256_ctx *ctx,
0119 size_t length, uint8_t *dst,
0120 const uint8_t *src);
0121
0122
0123
0124
0125
0126 #define camellia192_ctx camellia256_ctx
0127
0128 void
0129 camellia192_set_encrypt_key(struct camellia256_ctx *ctx,
0130 const uint8_t *key);
0131
0132 void
0133 camellia192_set_decrypt_key(struct camellia256_ctx *ctx,
0134 const uint8_t *key);
0135
0136 #define camellia192_invert_key camellia256_invert_key
0137 #define camellia192_crypt camellia256_crypt
0138
0139 #ifdef __cplusplus
0140 }
0141 #endif
0142
0143 #endif