summaryrefslogtreecommitdiff
path: root/ext/digest/rmd160/rmd160init.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/digest/rmd160/rmd160init.c')
-rw-r--r--ext/digest/rmd160/rmd160init.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/ext/digest/rmd160/rmd160init.c b/ext/digest/rmd160/rmd160init.c
index a066763..763867d 100644
--- a/ext/digest/rmd160/rmd160init.c
+++ b/ext/digest/rmd160/rmd160init.c
@@ -8,14 +8,14 @@
#include "rmd160.h"
#endif
-static algo_t rmd160 = {
- 1,
+static rb_digest_metadata_t rmd160 = {
+ RUBY_DIGEST_API_VERSION,
RMD160_DIGEST_LENGTH,
RMD160_BLOCK_LENGTH,
sizeof(RMD160_CTX),
- (hash_init_func_t)RMD160_Init,
- (hash_update_func_t)RMD160_Update,
- (hash_finish_func_t)RMD160_Finish,
+ (rb_digest_hash_init_func_t)RMD160_Init,
+ (rb_digest_hash_update_func_t)RMD160_Update,
+ (rb_digest_hash_finish_func_t)RMD160_Finish,
};
/*
@@ -27,7 +27,6 @@ void
Init_rmd160()
{
VALUE mDigest, cDigest_Base, cDigest_RMD160;
- ID id_metadata;
rb_require("digest");
@@ -36,8 +35,6 @@ Init_rmd160()
cDigest_RMD160 = rb_define_class_under(mDigest, "RMD160", cDigest_Base);
- id_metadata = rb_intern("metadata");
-
- rb_ivar_set(cDigest_RMD160, id_metadata,
+ rb_ivar_set(cDigest_RMD160, rb_intern("metadata"),
Data_Wrap_Struct(rb_cObject, 0, 0, &rmd160));
}