aboutsummaryrefslogtreecommitdiffstats
path: root/lib/des.h
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-10-01 22:34:53 -0700
committerWilmer van der Gaast <wilmer@gaast.net>2010-10-01 22:34:53 -0700
commit62f53b508742804d5df6533150f17d41e6afcbb2 (patch)
treee01a02a2a730110dde6ded977458090859fe2115 /lib/des.h
parent05bf2a0d55999c944ac6cf03ad85270cb2165923 (diff)
parent04cd284bce74c114fde3043c951a5c8ef9eb79ae (diff)
Merging msnp13 branch which, confusingly, upgrades the msn module to use
MSNP15. (The reason for this is that A) IMHO MSNP13 is what causes most of the pain in this upgade and B) I initially intended to only implement MSNP13 but then discovered MS doesn't support it anymore.) This fixes issues with display names being forgotten, adding contacts (and them automatically getting blocked sometimes!!), and adds support for away/status messages and some support for sending offline messages.
Diffstat (limited to 'lib/des.h')
-rw-r--r--lib/des.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/lib/des.h b/lib/des.h
new file mode 100644
index 00000000..92fbfd22
--- /dev/null
+++ b/lib/des.h
@@ -0,0 +1,51 @@
+/*
+ * FIPS-46-3 compliant 3DES implementation
+ *
+ * Copyright (C) 2001-2003 Christophe Devine
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef _DES_H
+#define _DES_H
+
+#include <stdint.h>
+
+typedef struct
+{
+ uint32_t esk[32]; /* DES encryption subkeys */
+ uint32_t dsk[32]; /* DES decryption subkeys */
+}
+des_context;
+
+typedef struct
+{
+ uint32_t esk[96]; /* Triple-DES encryption subkeys */
+ uint32_t dsk[96]; /* Triple-DES decryption subkeys */
+}
+des3_context;
+
+int des_set_key( des_context *ctx, uint8_t key[8] );
+void des_encrypt( des_context *ctx, uint8_t input[8], uint8_t output[8] );
+void des_decrypt( des_context *ctx, uint8_t input[8], uint8_t output[8] );
+
+int des3_set_2keys( des3_context *ctx, const uint8_t key1[8], const uint8_t key2[8] );
+int des3_set_3keys( des3_context *ctx, const uint8_t key1[8], const uint8_t key2[8],
+ const uint8_t key3[8] );
+
+void des3_encrypt( des3_context *ctx, uint8_t input[8], uint8_t output[8] );
+void des3_decrypt( des3_context *ctx, uint8_t input[8], uint8_t output[8] );
+
+#endif /* des.h */