* md.c (md_algo_present): New function to check if a given algo is in use

for a given MD_HANDLE.
This commit is contained in:
David Shaw 2002-08-07 19:47:57 +00:00
parent c8b8326aae
commit faed12a698
2 changed files with 22 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2002-08-07 David Shaw <dshaw@jabberwocky.com>
* md.c (md_algo_present): New function to check if a given algo is
in use for a given MD_HANDLE.
2002-08-04 Werner Koch <wk@gnupg.org>
* blowfish.h, cast5.h, des.h: Removed after moving all prototypes to
@ -438,7 +443,6 @@ Mon Oct 4 21:23:04 CEST 1999 Werner Koch <wk@gnupg.de>
Sat Sep 18 12:51:51 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* Makefile.am: Never compile mingw32 as module
Wed Sep 15 14:39:59 CEST 1999 Michael Roth <mroth@nessie.de>

View File

@ -408,6 +408,23 @@ md_get_algo( MD_HANDLE a )
return 0;
}
/* Returns true if a given algo is in use in a md */
int
md_algo_present( MD_HANDLE a, int algo )
{
struct md_digest_list_s *r=a->list;
while(r)
{
if(r->algo==algo)
return 1;
r=r->next;
}
return 0;
}
/****************
* Return the length of the digest
*/
@ -485,4 +502,3 @@ md_stop_debug( MD_HANDLE md )
}
#endif
}