summaryrefslogtreecommitdiff
path: root/ext/digest/lib
diff options
context:
space:
mode:
Diffstat (limited to 'ext/digest/lib')
-rw-r--r--ext/digest/lib/digest/hmac.rb8
1 files changed, 1 insertions, 7 deletions
diff --git a/ext/digest/lib/digest/hmac.rb b/ext/digest/lib/digest/hmac.rb
index 3eb83e5ff5..e6870f95c1 100644
--- a/ext/digest/lib/digest/hmac.rb
+++ b/ext/digest/lib/digest/hmac.rb
@@ -54,16 +54,10 @@ module Digest
ipad = Array.new(BLOCK_LENGTH).fill(0x36)
opad = Array.new(BLOCK_LENGTH).fill(0x5c)
- i = 0
- KEY.each_byte { |c|
+ KEY.bytes.each_with_index { |c, i|
ipad[i] ^= c
opad[i] ^= c
- i += 1
}
- #KEY.bytes.each_with_index { |c, i|
- # ipad[i] ^= c
- # opad[i] ^= c
- #}
@ipad = ipad.inject('') { |s, c| s << c.chr }
@opad = opad.inject('') { |s, c| s << c.chr }