aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/https/lgl/des.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/daemon/https/lgl/des.h')
-rw-r--r--src/daemon/https/lgl/des.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/daemon/https/lgl/des.h b/src/daemon/https/lgl/des.h
index 4d9eb20c..d2ad058e 100644
--- a/src/daemon/https/lgl/des.h
+++ b/src/daemon/https/lgl/des.h
@@ -62,12 +62,14 @@ extern void MHD_gl_des_setkey (MHD_gl_des_ctx * ctx, const char *key);
62/* Fill a DES context CTX with subkeys calculated from 64bit KEY, with 62/* Fill a DES context CTX with subkeys calculated from 64bit KEY, with
63 * weak key checking. Does not check parity bits, but simply ignore 63 * weak key checking. Does not check parity bits, but simply ignore
64 * them. */ 64 * them. */
65extern bool MHD_gl_des_makekey (MHD_gl_des_ctx * ctx, const char *key, size_t keylen); 65extern bool MHD_gl_des_makekey (MHD_gl_des_ctx * ctx, const char *key,
66 size_t keylen);
66 67
67/* Electronic Codebook Mode DES encryption/decryption of data 68/* Electronic Codebook Mode DES encryption/decryption of data
68 * according to 'mode'. */ 69 * according to 'mode'. */
69extern void 70extern void
70MHD_gl_des_ecb_crypt (MHD_gl_des_ctx * ctx, const char *from, char *to, int mode); 71MHD_gl_des_ecb_crypt (MHD_gl_des_ctx * ctx, const char *from, char *to,
72 int mode);
71 73
72#define MHD_gl_des_ecb_encrypt(ctx, from, to) MHD_gl_des_ecb_crypt(ctx, from, to, 0) 74#define MHD_gl_des_ecb_encrypt(ctx, from, to) MHD_gl_des_ecb_crypt(ctx, from, to, 0)
73#define MHD_gl_des_ecb_decrypt(ctx, from, to) MHD_gl_des_ecb_crypt(ctx, from, to, 1) 75#define MHD_gl_des_ecb_decrypt(ctx, from, to) MHD_gl_des_ecb_crypt(ctx, from, to, 1)
@@ -80,7 +82,8 @@ MHD_gl_des_ecb_crypt (MHD_gl_des_ctx * ctx, const char *from, char *to, int mode
80 * 64bit keys in KEY1 and KEY2. Does not check the parity bits of the 82 * 64bit keys in KEY1 and KEY2. Does not check the parity bits of the
81 * keys, but simply ignore them. Does not check for weak keys. */ 83 * keys, but simply ignore them. Does not check for weak keys. */
82extern void 84extern void
83MHD_gl_3des_set2keys (MHD_gl_3des_ctx * ctx, const char *key1, const char *key2); 85MHD_gl_3des_set2keys (MHD_gl_3des_ctx * ctx, const char *key1,
86 const char *key2);
84 87
85/* 88/*
86 * Fill a Triple-DES context CTX with subkeys calculated from three 89 * Fill a Triple-DES context CTX with subkeys calculated from three
@@ -89,7 +92,7 @@ MHD_gl_3des_set2keys (MHD_gl_3des_ctx * ctx, const char *key1, const char *key2)
89 * keys. */ 92 * keys. */
90extern void 93extern void
91MHD_gl_3des_set3keys (MHD_gl_3des_ctx * ctx, 94MHD_gl_3des_set3keys (MHD_gl_3des_ctx * ctx,
92 const char *key1, const char *key2, const char *key3); 95 const char *key1, const char *key2, const char *key3);
93 96
94/* Fill a Triple-DES context CTX with subkeys calculated from three 97/* Fill a Triple-DES context CTX with subkeys calculated from three
95 * concatenated 64bit keys in KEY, with weak key checking. Does not 98 * concatenated 64bit keys in KEY, with weak key checking. Does not
@@ -101,7 +104,8 @@ MHD_gl_3des_makekey (MHD_gl_3des_ctx * ctx, const char *key, size_t keylen);
101 * according to 'mode'. Sometimes this mode is named 'EDE' mode 104 * according to 'mode'. Sometimes this mode is named 'EDE' mode
102 * (Encryption-Decryption-Encryption). */ 105 * (Encryption-Decryption-Encryption). */
103extern void 106extern void
104MHD_gl_3des_ecb_crypt (MHD_gl_3des_ctx * ctx, const char *from, char *to, int mode); 107MHD_gl_3des_ecb_crypt (MHD_gl_3des_ctx * ctx, const char *from, char *to,
108 int mode);
105 109
106#define MHD_gl_3des_ecb_encrypt(ctx, from, to) MHD_gl_3des_ecb_crypt(ctx,from,to,0) 110#define MHD_gl_3des_ecb_encrypt(ctx, from, to) MHD_gl_3des_ecb_crypt(ctx,from,to,0)
107#define MHD_gl_3des_ecb_decrypt(ctx, from, to) MHD_gl_3des_ecb_crypt(ctx,from,to,1) 111#define MHD_gl_3des_ecb_decrypt(ctx, from, to) MHD_gl_3des_ecb_crypt(ctx,from,to,1)