diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/Makefile.am | 3 | ||||
-rw-r--r-- | tools/bftest.c | 18 |
2 files changed, 11 insertions, 10 deletions
diff --git a/tools/Makefile.am b/tools/Makefile.am index 2cf2e20ea..68d1044df 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -3,7 +3,8 @@ EXTRA_DIST = lspgpot INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/intl needed_libs = ../cipher/libcipher.la \ - ../mpi/libmpi.la ../util/libutil.la @INTLLIBS@ + ../mpi/libmpi.la ../util/libutil.la ../gcrypt/libgcrypt.la @INTLLIBS@ + noinst_PROGRAMS = mpicalc bftest clean-sat mk-tdata shmtest diff --git a/tools/bftest.c b/tools/bftest.c index 1b24b1c3f..8b8175901 100644 --- a/tools/bftest.c +++ b/tools/bftest.c @@ -27,8 +27,8 @@ #include <fcntl.h> #endif +#include <gcrypt.h> #include "util.h" -#include "cipher.h" #include "i18n.h" static void @@ -62,7 +62,7 @@ int main(int argc, char **argv) { int encode=0; - CIPHER_HANDLE hd; + GCRY_CIPHER_HD hd; char buf[4096]; int n, size=4096; int algo; @@ -92,21 +92,21 @@ main(int argc, char **argv) if( argc != 3 ) my_usage(); argc--; argv++; - algo = string_to_cipher_algo( *argv ); + algo = gcry_cipher_map_name( *argv ); argc--; argv++; - hd = cipher_open( algo, CIPHER_MODE_CFB, 0 ); - cipher_setkey( hd, *argv, strlen(*argv) ); - cipher_setiv( hd, NULL, 0 ); + hd = gcry_cipher_open( algo, GCRY_CIPHER_MODE_CFB, 0 ); + gcry_cipher_setkey( hd, *argv, strlen(*argv) ); + gcry_cipher_setiv( hd, NULL, 0 ); while( (n = fread( buf, 1, size, stdin )) > 0 ) { if( encode ) - cipher_encrypt( hd, buf, buf, n ); + gcry_cipher_encrypt( hd, buf, n, buf, n ); else - cipher_decrypt( hd, buf, buf, n ); + gcry_cipher_decrypt( hd, buf, n, buf, n ); if( fwrite( buf, 1, n, stdout) != n ) log_fatal("write error\n"); } - cipher_close(hd); + gcry_cipher_close(hd); return 0; } |