Add module 'gc-camellia'.
authorSimon Josefsson <simon@josefsson.org>
Mon, 22 Oct 2007 07:32:11 +0000 (09:32 +0200)
committerSimon Josefsson <simon@josefsson.org>
Mon, 22 Oct 2007 07:32:11 +0000 (09:32 +0200)
ChangeLog
lib/gc-libgcrypt.c
lib/gc.h
m4/gc-camellia.m4 [new file with mode: 0644]
modules/crypto/gc-camellia [new file with mode: 0644]

index aefe61d..4dfb941 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2007-10-22  Simon Josefsson  <simon@josefsson.org>
 
+       * modules/crypto/gc-camellia: New file.
+
+       * m4/gc-camellia.m4: New file.
+
+       * lib/gc-libgcrypt.c (gc_cipher_open): Support Camellia.
+
+       * lib/gc.h (enum Gc_cipher): Add GC_CAMELLIA128, GC_CAMELLIA256.
+
+2007-10-22  Simon Josefsson  <simon@josefsson.org>
+
        * build-aux/maint.mk (gzip_rsyncable): Don't fail if gzip sends
        --help to stdout.  Reported by sms@antinode.org (Steven
        M. Schweda).
index ea0de06..a147d44 100644 (file)
@@ -142,6 +142,16 @@ gc_cipher_open (Gc_cipher alg, Gc_cipher_mode mode,
       gcryalg = GCRY_CIPHER_RFC2268_40;
       break;
 
+#ifdef HAVE_CAMELLIA
+    case GC_CAMELLIA128:
+      gcryalg = GCRY_CIPHER_CAMELLIA128;
+      break;
+
+    case GC_CAMELLIA256:
+      gcryalg = GCRY_CIPHER_CAMELLIA256;
+      break;
+#endif
+
     default:
       return GC_INVALID_CIPHER;
     }
index d06b07e..33109fd 100644 (file)
--- a/lib/gc.h
+++ b/lib/gc.h
@@ -79,7 +79,9 @@ enum Gc_cipher
   GC_DES,
   GC_ARCFOUR128,
   GC_ARCFOUR40,
-  GC_ARCTWO40
+  GC_ARCTWO40,
+  GC_CAMELLIA128,
+  GC_CAMELLIA256
 };
 typedef enum Gc_cipher Gc_cipher;
 
diff --git a/m4/gc-camellia.m4 b/m4/gc-camellia.m4
new file mode 100644 (file)
index 0000000..c1fb02f
--- /dev/null
@@ -0,0 +1,20 @@
+# gc-camellia.m4 serial 1
+dnl Copyright (C) 2007 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_GC_CAMELLIA],
+[
+  AC_REQUIRE([gl_GC])
+  if test "$ac_cv_libgcrypt" = yes; then
+    AC_CACHE_CHECK([for camellia in libgcrypt], [gl_cv_libgcrypt_camellia], [
+      AC_TRY_COMPILE([#include <gcrypt.h>],
+        [return gcry_cipher_open (NULL, GCRY_CIPHER_CAMELLIA128, 0, 0);],
+        [gl_cv_libgcrypt_camellia=yes],
+        [gl_cv_libgcrypt_camellia=no])])
+    if test "$gl_cv_libgcrypt_camellia" = yes; then
+      AC_DEFINE(HAVE_CAMELLIA, 1, [Define if your libgcrypt supports Camellia.])
+    fi
+  fi
+])
diff --git a/modules/crypto/gc-camellia b/modules/crypto/gc-camellia
new file mode 100644 (file)
index 0000000..207ffa7
--- /dev/null
@@ -0,0 +1,23 @@
+Description:
+Generic crypto wrappers for Camellia block cipher.
+
+Files:
+m4/gc-camellia.m4
+
+Depends-on:
+crypto/gc
+
+configure.ac:
+gl_GC_CAMELLIA
+gl_MODULE_INDICATOR([gc-camellia])
+
+Makefile.am:
+
+Include:
+"gc.h"
+
+License:
+LGPLv2+
+
+Maintainer:
+Simon Josefsson