summaryrefslogtreecommitdiff
path: root/ext/digest/sha2/sha2init.c
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-10-11 05:15:15 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-10-11 05:15:15 +0000
commitcd58f3313e1dd60895e1888290f7e433bec67208 (patch)
tree9f83d84fbcd020e86e23c6bf68aed78590fe490e /ext/digest/sha2/sha2init.c
parent55b9887f970c21fcf483e14f940e860498a9606c (diff)
* ext/digest/digest.c (rb_digest_base_reset, Init_digest): Add
Digest::Base#reset. * ext/digest/digest.h: Update the header comment. * ext/digest/md5/md5ossl.h, ext/digest/md5/md5init.c (Init_md5): Define DIGEST_LENGTH and BLOCK_LENGTH. * ext/digest/rmd160/rmd160init.c (Init_rmd160): Ditto. * ext/digest/sha1/sha1init.c (Init_sha1): Ditto. * ext/digest/sha2/sha2init.c (Init_sha2): Ditto. * ext/digest/depend, ext/digest/extconf.rb: Use $INSTALLFILES rather than adding make targets. [Pointed out by: nobu] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/digest/sha2/sha2init.c')
-rw-r--r--ext/digest/sha2/sha2init.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/digest/sha2/sha2init.c b/ext/digest/sha2/sha2init.c
index 9484f2a..4fb845c 100644
--- a/ext/digest/sha2/sha2init.c
+++ b/ext/digest/sha2/sha2init.c
@@ -39,6 +39,9 @@ Init_sha2()
#define DEFINE_ALGO_CLASS(bitlen) \
cDigest_SHA##bitlen = rb_define_class_under(mDigest, "SHA" #bitlen, cDigest_Base); \
\
+ rb_define_const(cDigest_SHA##bitlen, "DIGEST_LENGTH", INT2NUM(SHA##bitlen##_DIGEST_LENGTH)); \
+ rb_define_const(cDigest_SHA##bitlen, "BLOCK_LENGTH", INT2NUM(SHA##bitlen##_BLOCK_LENGTH)); \
+\
rb_cvar_set(cDigest_SHA##bitlen, id_metadata, \
Data_Wrap_Struct(rb_cObject, 0, 0, &sha##bitlen), Qtrue);