mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
See ChangeLog: Mon Mar 13 19:22:46 CET 2000 Werner Koch
This commit is contained in:
parent
d1b6e0ce0d
commit
14a2e006bc
19 changed files with 1042 additions and 159 deletions
|
@ -1,3 +1,7 @@
|
|||
Mon Mar 13 19:22:46 CET 2000 Werner Koch <wk@openit.de>
|
||||
|
||||
* md.c (gcry_md_hash_buffer): Add support for the other algorithms.
|
||||
|
||||
Mon Jan 31 16:37:34 CET 2000 Werner Koch <wk@gnupg.de>
|
||||
|
||||
* genprime.c (generate_elg_prime): Fixed returned factors which never
|
||||
|
|
13
cipher/md.c
13
cipher/md.c
|
@ -596,15 +596,22 @@ gcry_md_get( GCRY_MD_HD hd, int algo, byte *buffer, int buflen )
|
|||
* Shortcut function to hash a buffer with a given algo. The only supported
|
||||
* algorithm is RIPE-MD. The supplied digest buffer must be large enough
|
||||
* to store the resulting hash. No error is returned, the function will
|
||||
* abort on an invalite algo. DISABLED_ALGOS are ignored here.
|
||||
* abort on an invalid algo. DISABLED_ALGOS are ignored here.
|
||||
*/
|
||||
void
|
||||
gcry_md_hash_buffer( int algo, char *digest, const char *buffer, size_t length)
|
||||
{
|
||||
if( algo == GCRY_MD_RMD160 )
|
||||
rmd160_hash_buffer( digest, buffer, length );
|
||||
else
|
||||
BUG();
|
||||
else { /* for the others we do not have a fast function, so
|
||||
* we use the normal functions to do it */
|
||||
GCRY_MD_HD h = md_open( algo, 0 );
|
||||
if( !h )
|
||||
BUG(); /* algo not available */
|
||||
md_write( h, (byte*)buffer, length );
|
||||
md_final( h );
|
||||
memcpy( digest, md_read( h, algo ), md_digest_length( algo ) );
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue