summaryrefslogtreecommitdiffstats
path: root/cipher
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>1998-02-16 21:05:02 +0100
committerWerner Koch <wk@gnupg.org>1998-02-16 21:05:02 +0100
commit82464369f664f821542c416d35d4013f9723f87a (patch)
treed127f2d891260ff1c6d4264630b2ba7bd463b1f4 /cipher
parentadded option export (diff)
downloadgnupg2-82464369f664f821542c416d35d4013f9723f87a.tar.xz
gnupg2-82464369f664f821542c416d35d4013f9723f87a.zip
some import functionality
Diffstat (limited to 'cipher')
-rw-r--r--cipher/ChangeLog7
-rw-r--r--cipher/Makefile.am3
-rw-r--r--cipher/Makefile.in4
-rw-r--r--cipher/misc.c50
4 files changed, 59 insertions, 5 deletions
diff --git a/cipher/ChangeLog b/cipher/ChangeLog
index e69de29bb..e915c3bcc 100644
--- a/cipher/ChangeLog
+++ b/cipher/ChangeLog
@@ -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.
+
+
diff --git a/cipher/Makefile.am b/cipher/Makefile.am
index ad6722876..2967363b4 100644
--- a/cipher/Makefile.am
+++ b/cipher/Makefile.am
@@ -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@
-
diff --git a/cipher/Makefile.in b/cipher/Makefile.in
index b8fe2a1bb..6264a0d59 100644
--- a/cipher/Makefile.in
+++ b/cipher/Makefile.in
@@ -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:
diff --git a/cipher/misc.c b/cipher/misc.c
index 7c8f2e3c7..6dcd20245 100644
--- a/cipher/misc.c
+++ b/cipher/misc.c
@@ -75,6 +75,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
*/
int
@@ -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
*/