summaryrefslogtreecommitdiff
path: root/ext/digest/digest.h
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-10-13 23:23:18 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-10-13 23:23:18 +0000
commitd87fc2bdd418fb71718375f3acb45a026a1352fa (patch)
treed9bad3e4332f56f68b89a9b1ef688f9aaa46fb21 /ext/digest/digest.h
parent694b2c7a29dc8e0f468053cafe85df7c63b20580 (diff)
* ext/digest/digest.c, ext/digest/digest.h,
ext/digest/md5/md5init.c, ext/digest/rmd160/rmd160init.c, ext/digest/sha1/sha1init.c, ext/digest/sha2/sha2init.c: Introduce API versioning. * ext/digest/digest.c, ext/digest/digest.h, ext/digest/md5/md5init.c, ext/digest/rmd160/rmd160init.c, ext/digest/sha1/sha1init.c, ext/digest/sha2/sha2init.c: Remove the constants DIGEST_LENGTH and BLOCK_LENGTH and turn them into instance methods digest_length() and block_length(). Class methods with the same names are also provided, which take extra parameters for a digest method. * ext/digest/lib/digest/hmac.rb: Completely redesign the API which is similar to Perl's, now that Digest classes can take hashing parameters. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/digest/digest.h')
-rw-r--r--ext/digest/digest.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/digest/digest.h b/ext/digest/digest.h
index ee3c680..f8c5dd3 100644
--- a/ext/digest/digest.h
+++ b/ext/digest/digest.h
@@ -20,7 +20,9 @@ typedef void (*hash_update_func_t)(void *, unsigned char *, size_t);
typedef void (*hash_finish_func_t)(void *, unsigned char *);
typedef struct {
+ int api_version;
size_t digest_len;
+ size_t block_len;
size_t ctx_size;
hash_init_func_t init_func;
hash_update_func_t update_func;