1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-14 21:47:19 +02:00

extensions are now working and fixed a lot of bugs

This commit is contained in:
Werner Koch 1998-06-15 15:41:04 +00:00
parent e662bf708b
commit 6e1ca6b80f
40 changed files with 350 additions and 454 deletions

View file

@ -38,7 +38,6 @@ static struct { const char *name; int algo;} digest_names[] = {
{ "RMD160", DIGEST_ALGO_RMD160 },
{ "RMD-160", DIGEST_ALGO_RMD160 },
{ "RIPE-MD-160", DIGEST_ALGO_RMD160 },
{ "TIGER", DIGEST_ALGO_TIGER },
{NULL} };
@ -79,9 +78,6 @@ int
check_digest_algo( int algo )
{
switch( algo ) {
#ifdef WITH_TIGER_HASH
case DIGEST_ALGO_TIGER:
#endif
case DIGEST_ALGO_MD5:
case DIGEST_ALGO_RMD160:
case DIGEST_ALGO_SHA1:
@ -134,13 +130,6 @@ md_enable( MD_HANDLE h, int algo )
sha1_init( &h->sha1 );
h->use_sha1 = 1;
}
#ifdef WITH_TIGER_HASH
else if( algo == DIGEST_ALGO_TIGER ) {
if( !h->use_tiger )
tiger_init( &h->tiger );
h->use_tiger = 1;
}
#endif
else
log_bug("md_enable(%d)", algo );
}
@ -186,12 +175,6 @@ md_write( MD_HANDLE a, byte *inbuf, size_t inlen)
sha1_write( &a->sha1, a->buffer, a->bufcount );
sha1_write( &a->sha1, inbuf, inlen );
}
#ifdef WITH_TIGER_HASH
if( a->use_tiger ) {
tiger_write( &a->tiger, a->buffer, a->bufcount );
tiger_write( &a->tiger, inbuf, inlen );
}
#endif
if( a->use_md5 ) {
md5_write( &a->md5, a->buffer, a->bufcount );
md5_write( &a->md5, inbuf, inlen );
@ -210,10 +193,6 @@ md_final(MD_HANDLE a)
rmd160_final( &a->rmd160 );
if( a->use_sha1 )
sha1_final( &a->sha1 );
#ifdef WITH_TIGER_HASH
if( a->use_tiger )
tiger_final( &a->tiger );
#endif
if( a->use_md5 )
md5_final( &a->md5 );
}
@ -230,10 +209,6 @@ md_read( MD_HANDLE a, int algo )
return rmd160_read( &a->rmd160 );
if( a->use_sha1 )
return sha1_read( &a->sha1 );
#ifdef WITH_TIGER_HASH
if( a->use_tiger )
return tiger_read( &a->tiger );
#endif
if( a->use_md5 )
return md5_read( &a->md5 );
}
@ -242,10 +217,6 @@ md_read( MD_HANDLE a, int algo )
return rmd160_read( &a->rmd160 );
if( algo == DIGEST_ALGO_SHA1 )
return sha1_read( &a->sha1 );
#ifdef WITH_TIGER_HASH
if( algo == DIGEST_ALGO_TIGER )
return tiger_read( &a->tiger );
#endif
if( algo == DIGEST_ALGO_MD5 )
return md5_read( &a->md5 );
}
@ -259,10 +230,6 @@ md_get_algo( MD_HANDLE a )
return DIGEST_ALGO_RMD160;
if( a->use_sha1 )
return DIGEST_ALGO_SHA1;
#ifdef WITH_TIGER_HASH
if( a->use_tiger )
return DIGEST_ALGO_TIGER;
#endif
if( a->use_md5 )
return DIGEST_ALGO_MD5;
return 0;
@ -275,8 +242,6 @@ int
md_digest_length( int algo )
{
switch( algo ) {
case DIGEST_ALGO_TIGER:
return 24;
case DIGEST_ALGO_RMD160:
case DIGEST_ALGO_SHA1:
return 20;