aboutsummaryrefslogtreecommitdiffstats
path: root/tools/bftest.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>1999-10-26 12:14:37 +0000
committerWerner Koch <[email protected]>1999-10-26 12:14:37 +0000
commitcf70ca8d68eb836b952f2c234f064b1afc205962 (patch)
treeaa33afbc79efd1f8538e5286b13d900321a8f14b /tools/bftest.c
parentChanged the way it works - now needs an extra program to to most tasks. (diff)
downloadgnupg-cf70ca8d68eb836b952f2c234f064b1afc205962.tar.gz
gnupg-cf70ca8d68eb836b952f2c234f064b1afc205962.zip
See ChangeLog: Tue Oct 26 14:10:21 CEST 1999 Werner Koch
Diffstat (limited to '')
-rw-r--r--tools/bftest.c18
1 files changed, 9 insertions, 9 deletions
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;
}