summaryrefslogtreecommitdiffstats
path: root/ext/digest/lib
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-11-01 05:01:43 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-11-01 05:01:43 +0000
commitd85ab1ae6eca0d24591be1e1b14709e763f70216 (patch)
treec89989104b5dcd8d8c326fb95d1f0650f246b5af /ext/digest/lib
parentf65f8c9e9462073a8d8f5317e2849706460569fe (diff)
downloadruby-d85ab1ae6eca0d24591be1e1b14709e763f70216.tar.gz
ruby-d85ab1ae6eca0d24591be1e1b14709e763f70216.tar.xz
ruby-d85ab1ae6eca0d24591be1e1b14709e763f70216.zip
* ext/digest/lib/digest/hmac.rb (Digest::HMAC::update): Minor
optimization. * ext/digest/digest.c (rb_digest_instance_equal): Allow comparing a digest instance with another of a different class. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@11254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/digest/lib')
-rw-r--r--ext/digest/lib/digest/hmac.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/digest/lib/digest/hmac.rb b/ext/digest/lib/digest/hmac.rb
index 117788418..0aeb6a8b4 100644
--- a/ext/digest/lib/digest/hmac.rb
+++ b/ext/digest/lib/digest/hmac.rb
@@ -67,7 +67,8 @@ module Digest
end
def update(text)
- @md.reset.update(@opad + @md.digest(@ipad + text))
+ # @md is reset when digest() returns
+ @md.update(@opad + @md.digest(@ipad + text))
self
end