diff options
| author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-10-11 05:15:15 +0000 |
|---|---|---|
| committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-10-11 05:15:15 +0000 |
| commit | 50938caee55064722c2aebda177ddb463aaed58c (patch) | |
| tree | 9f83d84fbcd020e86e23c6bf68aed78590fe490e /ext/digest/md5 | |
| parent | 10b921e1ce83b6965fed9f2b6069ad3f02992678 (diff) | |
| download | ruby-50938caee55064722c2aebda177ddb463aaed58c.tar.gz ruby-50938caee55064722c2aebda177ddb463aaed58c.tar.xz ruby-50938caee55064722c2aebda177ddb463aaed58c.zip | |
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@11122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/digest/md5')
| -rw-r--r-- | ext/digest/md5/md5init.c | 3 | ||||
| -rw-r--r-- | ext/digest/md5/md5ossl.h | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/ext/digest/md5/md5init.c b/ext/digest/md5/md5init.c index 5fddb21c6..4dc0c3bff 100644 --- a/ext/digest/md5/md5init.c +++ b/ext/digest/md5/md5init.c @@ -29,6 +29,9 @@ Init_md5() cDigest_MD5 = rb_define_class_under(mDigest, "MD5", cDigest_Base); + rb_define_const(cDigest_MD5, "DIGEST_LENGTH", INT2NUM(MD5_DIGEST_LENGTH)); + rb_define_const(cDigest_MD5, "BLOCK_LENGTH", INT2NUM(MD5_BLOCK_LENGTH)); + rb_cvar_set(cDigest_MD5, rb_intern("metadata"), Data_Wrap_Struct(rb_cObject, 0, 0, &md5), Qtrue); } diff --git a/ext/digest/md5/md5ossl.h b/ext/digest/md5/md5ossl.h index bccbe05f2..ec629c55d 100644 --- a/ext/digest/md5/md5ossl.h +++ b/ext/digest/md5/md5ossl.h @@ -6,6 +6,8 @@ #include <stddef.h> #include <openssl/md5.h> +#define MD5_BLOCK_LENGTH MD5_CBLOCK + void MD5_Finish(MD5_CTX *pctx, unsigned char *digest); int MD5_Equal(MD5_CTX *pctx1, MD5_CTX *pctx2); |
