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

some import functionality

This commit is contained in:
Werner Koch 1998-02-16 20:05:02 +00:00
parent f477447d9a
commit 82464369f6
45 changed files with 1299 additions and 324 deletions

View file

@ -0,0 +1,7 @@
Mon Feb 16 10:08:47 1998 Werner Koch (wk@isil.d.shuttle.de)
* misc.c (cipher_algo_to_string): New
(pubkey_algo_to_string): New.
(digest_algo_to_string): New.

View file

@ -27,8 +27,7 @@ libcipher_a_SOURCES = blowfish.c \
misc.c \
smallprime.c
libcipher_a_DEPENDENCIES = @CIPHER_EXTRA_OBJS@
libcipher_a_LIBADD = @CIPHER_EXTRA_OBJS@
$(LIBRARIES): @CIPHER_EXTRA_OBJS@

View file

@ -112,6 +112,7 @@ libcipher_a_SOURCES = blowfish.c \
misc.c \
smallprime.c
libcipher_a_DEPENDENCIES = @CIPHER_EXTRA_OBJS@
libcipher_a_LIBADD = @CIPHER_EXTRA_OBJS@
mkinstalldirs = $(SHELL) $(top_srcdir)/scripts/mkinstalldirs
CONFIG_HEADER = ../config.h
@ -123,7 +124,6 @@ DEFS = @DEFS@ -I. -I$(srcdir) -I..
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
libcipher_a_DEPENDENCIES =
libcipher_a_OBJECTS = blowfish.o elgamal.o gost.o md5.o primegen.o \
random.o rmd160.o sha1.o dsa.o md.o misc.o smallprime.o
AR = ar
@ -316,8 +316,6 @@ installdirs mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
$(LIBRARIES): @CIPHER_EXTRA_OBJS@
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View file

@ -74,6 +74,21 @@ string_to_cipher_algo( const char *string )
}
/****************
* Map a cipher algo to a string
*/
const char *
cipher_algo_to_string( int algo )
{
int i;
for(i=0; cipher_names[i].name; i++ )
if( cipher_names[i].algo == algo )
return cipher_names[i].name;
return NULL;
}
/****************
* Map a string to the pubkey algo
*/
@ -89,6 +104,23 @@ string_to_pubkey_algo( const char *string )
return 0;
}
/****************
* Map a pubkey algo to a string
*/
const char *
pubkey_algo_to_string( int algo )
{
int i;
for(i=0; pubkey_names[i].name; i++ )
if( pubkey_names[i].algo == algo )
return pubkey_names[i].name;
return NULL;
}
/****************
* Map a string to the digest algo
*/
@ -104,6 +136,24 @@ string_to_digest_algo( const char *string )
return 0;
}
/****************
* Map a digest algo to a string
*/
const char *
digest_algo_to_string( int algo )
{
int i;
for(i=0; digest_names[i].name; i++ )
if( digest_names[i].algo == algo )
return digest_names[i].name;
return NULL;
}
/****************
* Return 0 if the cipher algo is available
*/