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 #ifndef NETTLE_CAST128_H_INCLUDED
0035 #define NETTLE_CAST128_H_INCLUDED
0036
0037 #include "nettle-types.h"
0038
0039 #ifdef __cplusplus
0040 extern "C" {
0041 #endif
0042
0043
0044 #define cast5_set_key nettle_cast5_set_key
0045 #define cast128_set_key nettle_cast128_set_key
0046 #define cast128_encrypt nettle_cast128_encrypt
0047 #define cast128_decrypt nettle_cast128_decrypt
0048
0049 #define CAST128_BLOCK_SIZE 8
0050
0051
0052 #define CAST5_MIN_KEY_SIZE 5
0053 #define CAST5_MAX_KEY_SIZE 16
0054
0055 #define CAST128_KEY_SIZE 16
0056
0057 struct cast128_ctx
0058 {
0059 unsigned rounds;
0060
0061 unsigned char Kr[16];
0062 uint32_t Km[16];
0063 };
0064
0065
0066 void
0067 cast5_set_key(struct cast128_ctx *ctx,
0068 size_t length, const uint8_t *key);
0069
0070 void
0071 cast128_set_key(struct cast128_ctx *ctx, const uint8_t *key);
0072
0073 void
0074 cast128_encrypt(const struct cast128_ctx *ctx,
0075 size_t length, uint8_t *dst,
0076 const uint8_t *src);
0077 void
0078 cast128_decrypt(const struct cast128_ctx *ctx,
0079 size_t length, uint8_t *dst,
0080 const uint8_t *src);
0081
0082 #ifdef __cplusplus
0083 }
0084 #endif
0085
0086 #endif