Mercurial > hg > octave-lyh > gnulib-hg
changeset 9390:e6944904022b
Add module 'gc-camellia'.
author | Simon Josefsson <simon@josefsson.org> |
---|---|
date | Mon, 22 Oct 2007 09:32:11 +0200 |
parents | 086b5dd6c3be |
children | f91466f94f23 |
files | ChangeLog lib/gc-libgcrypt.c lib/gc.h m4/gc-camellia.m4 modules/crypto/gc-camellia |
diffstat | 5 files changed, 66 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +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
--- a/lib/gc-libgcrypt.c +++ b/lib/gc-libgcrypt.c @@ -142,6 +142,16 @@ 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; }
--- a/lib/gc.h +++ b/lib/gc.h @@ -79,7 +79,9 @@ GC_DES, GC_ARCFOUR128, GC_ARCFOUR40, - GC_ARCTWO40 + GC_ARCTWO40, + GC_CAMELLIA128, + GC_CAMELLIA256 }; typedef enum Gc_cipher Gc_cipher;
new file mode 100644 --- /dev/null +++ b/m4/gc-camellia.m4 @@ -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 +])
new file mode 100644 --- /dev/null +++ b/modules/crypto/gc-camellia @@ -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