File indexing completed on 2025-01-18 10:02:16
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
0036
0037
0038
0039 #ifndef NETTLE_SERPENT_H_INCLUDED
0040 #define NETTLE_SERPENT_H_INCLUDED
0041
0042 #include "nettle-types.h"
0043
0044 #ifdef __cplusplus
0045 extern "C" {
0046 #endif
0047
0048
0049 #define serpent_set_key nettle_serpent_set_key
0050 #define serpent128_set_key nettle_serpent128_set_key
0051 #define serpent192_set_key nettle_serpent192_set_key
0052 #define serpent256_set_key nettle_serpent256_set_key
0053 #define serpent_encrypt nettle_serpent_encrypt
0054 #define serpent_decrypt nettle_serpent_decrypt
0055
0056 #define SERPENT_BLOCK_SIZE 16
0057
0058
0059
0060
0061
0062
0063 #define SERPENT_KEY_SIZE 32
0064
0065
0066
0067 #define SERPENT_MIN_KEY_SIZE 16
0068 #define SERPENT_MAX_KEY_SIZE 32
0069
0070 #define SERPENT128_KEY_SIZE 16
0071 #define SERPENT192_KEY_SIZE 24
0072 #define SERPENT256_KEY_SIZE 32
0073
0074 struct serpent_ctx
0075 {
0076 uint32_t keys[33][4];
0077 };
0078
0079 void
0080 serpent_set_key(struct serpent_ctx *ctx,
0081 size_t length, const uint8_t *key);
0082 void
0083 serpent128_set_key(struct serpent_ctx *ctx, const uint8_t *key);
0084 void
0085 serpent192_set_key(struct serpent_ctx *ctx, const uint8_t *key);
0086 void
0087 serpent256_set_key(struct serpent_ctx *ctx, const uint8_t *key);
0088
0089 void
0090 serpent_encrypt(const struct serpent_ctx *ctx,
0091 size_t length, uint8_t *dst,
0092 const uint8_t *src);
0093 void
0094 serpent_decrypt(const struct serpent_ctx *ctx,
0095 size_t length, uint8_t *dst,
0096 const uint8_t *src);
0097
0098 #ifdef __cplusplus
0099 }
0100 #endif
0101
0102 #endif