1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

See ChangeLog: Tue Oct 26 14:10:21 CEST 1999 Werner Koch

This commit is contained in:
Werner Koch 1999-10-26 12:14:37 +00:00
parent df4ecbb8d9
commit cf70ca8d68
71 changed files with 4032 additions and 2869 deletions

View file

@ -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

View file

@ -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;
}