diff options
Diffstat (limited to 'decrepit')
-rw-r--r-- | decrepit/ripemd/internal.h | 16 | ||||
-rw-r--r-- | decrepit/ripemd/ripemd.c | 18 |
2 files changed, 19 insertions, 15 deletions
diff --git a/decrepit/ripemd/internal.h b/decrepit/ripemd/internal.h index c4db4b23..dea532ba 100644 --- a/decrepit/ripemd/internal.h +++ b/decrepit/ripemd/internal.h @@ -74,21 +74,7 @@ static void ripemd160_block_data_order(uint32_t h[5], const uint8_t *data, #define HASH_CBLOCK RIPEMD160_CBLOCK #define HASH_UPDATE RIPEMD160_Update #define HASH_TRANSFORM RIPEMD160_Transform -#define HASH_FINAL RIPEMD160_Final -#define HASH_MAKE_STRING(c, s) \ - do { \ - unsigned long ll; \ - ll = (c)->h[0]; \ - (void)HOST_l2c(ll, (s)); \ - ll = (c)->h[1]; \ - (void)HOST_l2c(ll, (s)); \ - ll = (c)->h[2]; \ - (void)HOST_l2c(ll, (s)); \ - ll = (c)->h[3]; \ - (void)HOST_l2c(ll, (s)); \ - ll = (c)->h[4]; \ - (void)HOST_l2c(ll, (s)); \ - } while (0) +#define HASH_FINISH ripemd160_finish #define HASH_BLOCK_DATA_ORDER ripemd160_block_data_order #include "../../crypto/digest/md32_common.h" diff --git a/decrepit/ripemd/ripemd.c b/decrepit/ripemd/ripemd.c index 6ed7816c..c871ea76 100644 --- a/decrepit/ripemd/ripemd.c +++ b/decrepit/ripemd/ripemd.c @@ -71,6 +71,24 @@ int RIPEMD160_Init(RIPEMD160_CTX *ctx) { return 1; } +int RIPEMD160_Final(uint8_t *md, RIPEMD160_CTX *ctx) { + ripemd160_finish(ctx); + + unsigned long ll; + ll = ctx->h[0]; + (void)HOST_l2c(ll, md); + ll = ctx->h[1]; + (void)HOST_l2c(ll, md); + ll = ctx->h[2]; + (void)HOST_l2c(ll, md); + ll = ctx->h[3]; + (void)HOST_l2c(ll, md); + ll = ctx->h[4]; + (void)HOST_l2c(ll, md); + + return 1; +} + static void ripemd160_block_data_order(uint32_t h[5], const uint8_t *data, size_t num) { uint32_t A, B, C, D, E; |