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 +4 -4
- data/lib/eth/rpc_signer.rb +12 -0
- data/lib/eth/utils.rb +1 -1
- data/lib/eth/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da499545215301e15a8de2cdc5e9126fe64ea118
|
4
|
+
data.tar.gz: 01a0aa3dd050ee349b627904e95c98c96ba78b26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1357b4a3db96ba745bba5f4962c88f8485fb9b987c291c57ebef94ffff7f19224b4a7c0f3884d3076dbdc7553de1ecd8302e27df1bdcb46cd4bc3afbfd30ad8
|
7
|
+
data.tar.gz: ecb0c0143f762b5528e1c137ee648ccb02d4e448ec989215bfd97b0736277e133fa4ff00fe9c86379b64d1751d568124a6da8c00a8efcbe2ea62a0f907009459
|
data/lib/eth/rpc_signer.rb
CHANGED
@@ -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
|
|
data/lib/eth/utils.rb
CHANGED
@@ -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::
|
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
|
data/lib/eth/version.rb
CHANGED
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.
|
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:
|
12
|
+
date: 2018-03-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: digest-sha3
|