5 #include <netinet/in.h>
10 #include <nettle/md5.h>
11 #include <nettle/sha.h>
13 static void alg_serpent_makekey(void *schedule, const void *key, int keylen) {
14 serpent_makekey(schedule, key, keylen);
17 static void alg_serpent_encrypt(const void *sch, const void *in, void *out) {
18 serpent_encrypt(in, out, sch);
21 static void alg_serpent_decrypt(const void *sch, const void *in, void *out) {
22 serpent_decrypt(in, out, sch);
25 const BlockCipherAlgInfo blockcipheralginfos[]= {
26 { "serpent", 16, sizeof(SerpentKeySchedule), 16,32,
27 serpent_byteswap_block,
28 { alg_serpent_makekey, alg_serpent_encrypt },
29 { alg_serpent_makekey, alg_serpent_decrypt } },
33 #define NETTLE_DIGESTS \
38 #define DO(name,NAME) \
39 static void alg_##name##_init(void *state) { \
42 static void alg_##name##_update(void *state, const void *data, int len) { \
43 name##_update(state, len, data); \
45 static void alg_##name##_final(void *state, void *digest) { \
46 name##_digest(state,NAME##_DIGEST_SIZE,digest); \
48 static void alg_##name##_oneshot(void *digest, const void *data, int len) { \
49 struct name##_ctx ctx; \
51 name##_update(&ctx, len, data); \
52 name##_digest(&ctx,NAME##_DIGEST_SIZE,digest); \
57 const HashAlgInfo hashalginfos[]= {
58 #define DO(name,NAME) \
59 { #name, NAME##_DIGEST_SIZE, NAME##_DATA_SIZE, sizeof(struct name##_ctx), \
60 alg_##name##_init, alg_##name##_update, alg_##name##_final, \
61 alg_##name##_oneshot },