mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
See ChangeLog: Wed Feb 10 17:15:39 CET 1999 Werner Koch
This commit is contained in:
parent
a16e15282a
commit
9a4f506a18
60 changed files with 2006 additions and 1340 deletions
|
@ -27,6 +27,7 @@
|
|||
#include "memory.h"
|
||||
#include "rmd.h"
|
||||
#include "cipher.h" /* only used for the rmd160_hash_buffer() prototype */
|
||||
#include "dynload.h"
|
||||
|
||||
/*********************************
|
||||
* RIPEMD-160 is not patented, see (as of 25.10.97)
|
||||
|
@ -554,7 +555,7 @@ rmd160_hash_buffer( char *outbuf, const char *buffer, size_t length )
|
|||
* Returns: A pointer to string describing the algorithm or NULL if
|
||||
* the ALGO is invalid.
|
||||
*/
|
||||
const char *
|
||||
static const char *
|
||||
rmd160_get_info( int algo, size_t *contextsize,
|
||||
byte **r_asnoid, int *r_asnlen, int *r_mdlen,
|
||||
void (**r_init)( void *c ),
|
||||
|
@ -582,3 +583,63 @@ rmd160_get_info( int algo, size_t *contextsize,
|
|||
return "RIPEMD160";
|
||||
}
|
||||
|
||||
|
||||
#ifndef IS_MODULE
|
||||
static
|
||||
#endif
|
||||
const char * const gnupgext_version = "RMD160 ($Revision$)";
|
||||
|
||||
static struct {
|
||||
int class;
|
||||
int version;
|
||||
int value;
|
||||
void (*func)(void);
|
||||
} func_table[] = {
|
||||
{ 10, 1, 0, (void(*)(void))rmd160_get_info },
|
||||
{ 11, 1, 3 },
|
||||
};
|
||||
|
||||
|
||||
#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
|
||||
rmd160_constructor(void)
|
||||
{
|
||||
register_internal_cipher_extension( gnupgext_version, gnupgext_enum_func );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue