digix-eth 0.5.5 → 0.5.6

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: 5be7dffc1a811fbdc04ef6f2d3b7225846dc8878
4
- data.tar.gz: 9a65fa1b1600a634f472b9e3352746cb0caff1b7
3
+ metadata.gz: da499545215301e15a8de2cdc5e9126fe64ea118
4
+ data.tar.gz: 01a0aa3dd050ee349b627904e95c98c96ba78b26
5
5
  SHA512:
6
- metadata.gz: c62931153bfd8e1f287a0534ff5144bb418ff15d0095e6f753bf652aaeb66fb9e3848a0ecadc941bc7c8cf22a11cacae3922811e6ec24f47c47d3d7c935aaf4e
7
- data.tar.gz: fc12cc2637cc2ba44f10a94149101644d002baf6851021aacd9d80d23347a005e18cdd447d64c758f0b2f712cfcc98d4ff25a53b02593542ea22d622872355fc
6
+ metadata.gz: e1357b4a3db96ba745bba5f4962c88f8485fb9b987c291c57ebef94ffff7f19224b4a7c0f3884d3076dbdc7553de1ecd8302e27df1bdcb46cd4bc3afbfd30ad8
7
+ data.tar.gz: ecb0c0143f762b5528e1c137ee648ccb02d4e448ec989215bfd97b0736277e133fa4ff00fe9c86379b64d1751d568124a6da8c00a8efcbe2ea62a0f907009459
@@ -18,6 +18,18 @@ module Eth
18
18
  return payload
19
19
  end
20
20
 
21
+ class << self
22
+
23
+
24
+ def ecrecover_address(message_hash_hex, signature_hex)
25
+ message_hash = Eth::Utils.hex_to_bin(message_hash_hex)
26
+ signature = Eth::Utils.hex_to_bin(signature_hex)
27
+ public_key = Eth::OpenSsl.recover_compact(message_hash, signature)
28
+ signer = Eth::Utils.public_key_to_address(public_key)
29
+ return signer
30
+ end
31
+ end
32
+
21
33
  end
22
34
 
23
35
 
@@ -47,7 +47,7 @@ module Eth
47
47
  r = buffer[0..32]
48
48
  s = buffer[33..64]
49
49
  signature = [v, r, s].flatten.pack('C*')
50
- signature_hex = Eth::Util.bin_to_prefixed_hex(signature)
50
+ signature_hex = Eth::Utils.bin_to_prefixed_hex(signature)
51
51
  payload = {v: v, r: r, s: s, signature: signature, signature_hex: signature_hex}
52
52
  return payload
53
53
  end
@@ -1,3 +1,3 @@
1
1
  module Eth
2
- VERSION = "0.5.5"
2
+ VERSION = "0.5.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: digix-eth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.5
4
+ version: 0.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Ellis
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2017-07-20 00:00:00.000000000 Z
12
+ date: 2018-03-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: digest-sha3