diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-07-15 14:59:20 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-07-15 14:59:20 +0000 |
commit | aadebb29da14b65f47cf3e08ac164e6fe191febe (patch) | |
tree | 24a6148536d413890c668b7ce50e10942188711a /ext/digest/rmd160/rmd160.c | |
parent | 6046b9f149ec748a11d7b23c6cf485fb3e079e5a (diff) |
ext/digest: return values of init and final
* ext/digest: make built-in digest function implementations
indicate success or failure of init and final functions.
[ruby-core:61614] [Bug #9659]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/digest/rmd160/rmd160.c')
-rw-r--r-- | ext/digest/rmd160/rmd160.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/digest/rmd160/rmd160.c b/ext/digest/rmd160/rmd160.c index bac77833b1..058d004f3a 100644 --- a/ext/digest/rmd160/rmd160.c +++ b/ext/digest/rmd160/rmd160.c @@ -124,7 +124,7 @@ /********************************************************************/ -void +int RMD160_Init(RMD160_CTX *context) { @@ -138,6 +138,7 @@ RMD160_Init(RMD160_CTX *context) context->state[4] = 0xc3d2e1f0U; context->length[0] = context->length[1] = 0; context->buflen = 0; + return 1; } /********************************************************************/ @@ -412,7 +413,7 @@ RMD160_Update(RMD160_CTX *context, const uint8_t *data, size_t nbytes) /********************************************************************/ -void +int RMD160_Finish(RMD160_CTX *context, uint8_t digest[20]) { uint32_t i; @@ -456,6 +457,7 @@ RMD160_Finish(RMD160_CTX *context, uint8_t digest[20]) digest[i + 3] = (context->state[i>>2] >> 24); } } + return 1; } /************************ end of file rmd160.c **********************/ |