btcruby 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 259e4ee0ead1612a0af37185e4da5eef97238912
4
- data.tar.gz: 1b7f28e68c728175a0fc2c499b57291e58b9df0d
3
+ metadata.gz: 47f8d99f965f48b15252c34e99721b005d2eed0d
4
+ data.tar.gz: a364c03eccb5174fe5f110f466bac5e3f147b68c
5
5
  SHA512:
6
- metadata.gz: a0bb5fbceb5754b8a2ca60085aea0767adf9bec1b6fda5072dd11dd845f640b9aea7507900766165031f4d1b41851da48e0ef1dcb7fb4128311b81272eb5a232
7
- data.tar.gz: a864ca92fe3cb78465c6bd4d1b9a042f0c9afbb495f7d7b6a77d224df6fd0b02234919fe6b887d4927d24db0dda7386a3f9f69c0a26ccd5234aeb4b0d3262178
6
+ metadata.gz: 4161f2211ab6fce89f3e56d2ceef2eb977ffb55c71279ae94e52633b54e06a241ded2607e66db06d945c421e7d05d0ed519daeda839781c87a3b896b261c38ea
7
+ data.tar.gz: d21def19c9077a78da729fe3604582fb2144607569a9cf85551a73891267967f92e583307ec98fd612f94b1dde6910521751eb5ed89d88ffbe9e767427ddf5f5
@@ -1,7 +1,7 @@
1
1
  require 'digest/sha1'
2
2
  require 'digest/sha2'
3
3
  require 'digest/rmd160'
4
- require 'digest/hmac'
4
+ require 'openssl'
5
5
 
6
6
  module BTC
7
7
 
@@ -40,14 +40,17 @@ module BTC
40
40
  ripemd160(sha256(data))
41
41
  end
42
42
 
43
+ OPENSSL_DIGEST_NAME_SHA256 = 'sha256'.freeze
44
+ OPENSSL_DIGEST_NAME_SHA512 = 'sha512'.freeze
45
+
43
46
  def hmac_sha256(data: nil, key: nil)
44
47
  raise ArgumentError, "Data is missing" if !data || !key
45
- Digest::HMAC.digest(data, key, Digest::SHA256)
48
+ ::OpenSSL::HMAC.digest(OPENSSL_DIGEST_NAME_SHA256, key, data)
46
49
  end
47
50
 
48
51
  def hmac_sha512(data: nil, key: nil)
49
52
  raise ArgumentError, "Data is missing" if !data || !key
50
- Digest::HMAC.digest(data, key, Digest::SHA512)
53
+ ::OpenSSL::HMAC.digest(OPENSSL_DIGEST_NAME_SHA512, key, data)
51
54
  end
52
55
 
53
56
  end
@@ -1,3 +1,3 @@
1
1
  module BTC
2
- VERSION = "1.0.0".freeze
2
+ VERSION = "1.0.1".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: btcruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleg Andreev
@@ -172,7 +172,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
172
172
  version: '0'
173
173
  requirements: []
174
174
  rubyforge_project: btcruby
175
- rubygems_version: 2.2.2
175
+ rubygems_version: 2.4.5
176
176
  signing_key:
177
177
  specification_version: 4
178
178
  summary: Ruby library for interacting with Bitcoin.