diff options
author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-10-10 05:01:33 +0000 |
---|---|---|
committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-10-10 05:01:33 +0000 |
commit | 9b2fa26be45b051ebdfc2cf06a13aff0caf58c00 (patch) | |
tree | 8818dd11554f69d2861cd20e9396b6227d976453 /ext/digest/rmd160/rmd160ossl.c | |
parent | 6d83e40c327df4fbd3214815022ab66a215ce995 (diff) |
* ext/digest: Merge from trunk; apply all changes since the
initial import, except for the removal of compatibility stub
libraries (md5.rb and sha1.rb).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/digest/rmd160/rmd160ossl.c')
-rw-r--r-- | ext/digest/rmd160/rmd160ossl.c | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/ext/digest/rmd160/rmd160ossl.c b/ext/digest/rmd160/rmd160ossl.c index 2989ffd00e..247fd04afd 100644 --- a/ext/digest/rmd160/rmd160ossl.c +++ b/ext/digest/rmd160/rmd160ossl.c @@ -5,31 +5,8 @@ #include <assert.h> #include <stdlib.h> -#ifndef _DIAGASSERT -#define _DIAGASSERT(cond) assert(cond) -#endif - -char * -RMD160_End(RMD160_CTX *ctx, char *buf) -{ - size_t i; - char *p = buf; - uint8_t digest[20]; - static const char hex[]="0123456789abcdef"; - - _DIAGASSERT(ctx != NULL); - /* buf may be NULL */ - - if (p == NULL && (p = malloc(41)) == NULL) - return 0; - - RMD160_Final(digest,ctx); - for (i = 0; i < 20; i++) { - p[i + i] = hex[(uint32_t)digest[i] >> 4]; - p[i + i + 1] = hex[digest[i] & 0x0f]; - } - p[i + i] = '\0'; - return(p); +void RMD160_Finish(RMD160_CTX *ctx, char *buf) { + RIPEMD160_Final(buf, ctx); } int RMD160_Equal(RMD160_CTX* pctx1, RMD160_CTX* pctx2) { |