diff --git a/lib/openssl/ccm.rb b/lib/openssl/ccm.rb index 880d09c..8a903dc 100644 --- a/lib/openssl/ccm.rb +++ b/lib/openssl/ccm.rb @@ -119,6 +119,7 @@ def mac(data, nonce, additional_data) @cipher.reset @cipher.encrypt @cipher.key = @key + @cipher.iv = "\x00" * 16 b_0 = Array.new(8, 0) b_0[0] = (additional_data.empty? ? 0 : 64) \ @@ -164,6 +165,7 @@ def get_counter(nonce, index) @cipher.reset @cipher.encrypt @cipher.key = @key + @cipher.iv = "\x00" * 16 @cipher.update(a.pack('C*')) end end