regex: also remove dependency on HAVE_WCSCOLL
[gnulib.git] / lib / des.h
index c159607..f4cb125 100644 (file)
--- a/lib/des.h
+++ b/lib/des.h
@@ -1,5 +1,5 @@
 /* des.h --- DES cipher implementation.
- * Copyright (C) 2005 Free Software Foundation, Inc.
+ * Copyright (C) 2005, 2007, 2009-2013 Free Software Foundation, Inc.
  *
  * This file is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published
@@ -12,9 +12,7 @@
  * General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this file; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * along with this file; if not, see <http://www.gnu.org/licenses/>.
  *
  */
 
@@ -34,7 +32,7 @@ typedef struct
 {
   uint32_t encrypt_subkeys[32];
   uint32_t decrypt_subkeys[32];
-} des_ctx;
+} gl_des_ctx;
 
 /*
  * Encryption/Decryption context of Triple-DES
@@ -43,12 +41,12 @@ typedef struct
 {
   uint32_t encrypt_subkeys[96];
   uint32_t decrypt_subkeys[96];
-} tripledes_ctx;
+} gl_3des_ctx;
 
 /* Check whether the 8 byte key is weak.  Does not check the parity
  * bits of the key but simple ignore them. */
 extern bool
-des_is_weak_key (const char * key);
+gl_des_is_weak_key (const char * key);
 
 /*
  * DES
@@ -59,21 +57,21 @@ des_is_weak_key (const char * key);
  * Does not check parity bits, but simply ignore them.  Does not check
  * for weak keys. */
 extern void
-des_setkey (des_ctx *ctx, const char * key);
+gl_des_setkey (gl_des_ctx *ctx, const char * key);
 
 /* Fill a DES context CTX with subkeys calculated from 64bit KEY, with
  * weak key checking.  Does not check parity bits, but simply ignore
  * them. */
 extern bool
-des_makekey (des_ctx *ctx, const char * key, size_t keylen);
+gl_des_makekey (gl_des_ctx *ctx, const char * key, size_t keylen);
 
 /* Electronic Codebook Mode DES encryption/decryption of data
  * according to 'mode'. */
 extern void
-des_ecb_crypt (des_ctx *ctx, const char * from,  char * to, int mode);
+gl_des_ecb_crypt (gl_des_ctx *ctx, const char * from,  char * to, int mode);
 
-#define des_ecb_encrypt(ctx, from, to)       des_ecb_crypt(ctx, from, to, 0)
-#define des_ecb_decrypt(ctx, from, to)       des_ecb_crypt(ctx, from, to, 1)
+#define gl_des_ecb_encrypt(ctx, from, to)  gl_des_ecb_crypt(ctx, from, to, 0)
+#define gl_des_ecb_decrypt(ctx, from, to)  gl_des_ecb_crypt(ctx, from, to, 1)
 
 /* Triple-DES
  * ----------
@@ -83,7 +81,9 @@ des_ecb_crypt (des_ctx *ctx, const char * from,  char * to, int mode);
  * 64bit keys in KEY1 and KEY2.  Does not check the parity bits of the
  * keys, but simply ignore them.  Does not check for weak keys. */
 extern void
-tripledes_set2keys (tripledes_ctx *ctx, const char * key1, const char * key2);
+gl_3des_set2keys (gl_3des_ctx *ctx,
+                  const char * key1,
+                  const char * key2);
 
 /*
  * Fill a Triple-DES context CTX with subkeys calculated from three
@@ -91,24 +91,29 @@ tripledes_set2keys (tripledes_ctx *ctx, const char * key1, const char * key2);
  * of the keys, but simply ignore them.  Does not check for weak
  * keys. */
 extern void
-tripledes_set3keys (tripledes_ctx *ctx, const char * key1,
-                   const char * key2, const char * key3);
+gl_3des_set3keys (gl_3des_ctx *ctx,
+                  const char * key1,
+                  const char * key2,
+                  const char * key3);
 
 /* Fill a Triple-DES context CTX with subkeys calculated from three
  * concatenated 64bit keys in KEY, with weak key checking.  Does not
  * check the parity bits of the keys, but simply ignore them. */
 extern bool
-tripledes_makekey (tripledes_ctx *ctx, const char * key, size_t keylen);
+gl_3des_makekey (gl_3des_ctx *ctx,
+                 const char * key,
+                 size_t keylen);
 
 /* Electronic Codebook Mode Triple-DES encryption/decryption of data
  * according to 'mode'.  Sometimes this mode is named 'EDE' mode
  * (Encryption-Decryption-Encryption). */
 extern void
-tripledes_ecb_crypt (tripledes_ctx *ctx,
-                    const char * from,
-                    char * to, int mode);
+gl_3des_ecb_crypt (gl_3des_ctx *ctx,
+                   const char * from,
+                   char * to,
+                   int mode);
 
-#define tripledes_ecb_encrypt(ctx, from, to) tripledes_ecb_crypt(ctx,from,to,0)
-#define tripledes_ecb_decrypt(ctx, from, to) tripledes_ecb_crypt(ctx,from,to,1)
+#define gl_3des_ecb_encrypt(ctx, from, to) gl_3des_ecb_crypt(ctx,from,to,0)
+#define gl_3des_ecb_decrypt(ctx, from, to) gl_3des_ecb_crypt(ctx,from,to,1)
 
 #endif /* DES_H */