summaryrefslogtreecommitdiff
path: root/cipher/md5.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>1999-02-10 16:22:37 +0000
committerWerner Koch <wk@gnupg.org>1999-02-10 16:22:37 +0000
commita7f3353934272f03a3462eae96feaa35a54dd6fe (patch)
treed73578901be3da3cd0d34e43a92f04e0868ccafe /cipher/md5.c
parentfb72622bbd2a7bd6ae6cefdef1f0d69c76625f0f (diff)
downloadlibgcrypt-a7f3353934272f03a3462eae96feaa35a54dd6fe.tar.gz
See ChangeLog: Wed Feb 10 17:15:39 CET 1999 Werner Koch
Diffstat (limited to 'cipher/md5.c')
-rw-r--r--cipher/md5.c57
1 files changed, 55 insertions, 2 deletions
diff --git a/cipher/md5.c b/cipher/md5.c
index 214e1372..6a53deda 100644
--- a/cipher/md5.c
+++ b/cipher/md5.c
@@ -34,8 +34,8 @@
#include <string.h>
#include <assert.h>
#include "util.h"
-#include "md5.h"
#include "memory.h"
+#include "dynload.h"
typedef struct {
@@ -338,7 +338,7 @@ md5_read( MD5_CONTEXT *hd )
* Returns: A pointer to string describing the algorithm or NULL if
* the ALGO is invalid.
*/
-const char *
+static const char *
md5_get_info( int algo, size_t *contextsize,
byte **r_asnoid, int *r_asnlen, int *r_mdlen,
void (**r_init)( void *c ),
@@ -367,5 +367,58 @@ md5_get_info( int algo, size_t *contextsize,
}
+#ifndef IS_MODULE
+static
+#endif
+const char * const gnupgext_version = "MD5 ($Revision$)";
+
+static struct {
+ int class;
+ int version;
+ int value;
+ void (*func)(void);
+} func_table[] = {
+ { 10, 1, 0, (void(*)(void))md5_get_info },
+ { 11, 1, 1 },
+};
+
+
+#ifndef IS_MODULE
+static
+#endif
+void *
+gnupgext_enum_func( int what, int *sequence, int *class, int *vers )
+{
+ void *ret;
+ int i = *sequence;
+
+ do {
+ if( i >= DIM(func_table) || i < 0 )
+ return NULL;
+ *class = func_table[i].class;
+ *vers = func_table[i].version;
+ switch( *class ) {
+ case 11: case 21: case 31: ret = &func_table[i].value; break;
+ default: ret = func_table[i].func; break;
+ }
+ i++;
+ } while( what && what != *class );
+
+ *sequence = i;
+ return ret;
+}
+
+
+
+
+#ifndef IS_MODULE
+void
+md5_constructor(void)
+{
+ register_internal_cipher_extension( gnupgext_version, gnupgext_enum_func );
+}
+#endif
+
+
/* end of file */