tapyrus 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +1 -1
- data/{.prettierrc.yaml → .prettierrc.yml} +0 -1
- data/.ruby-version +1 -1
- data/Gemfile +2 -2
- data/README.md +1 -1
- data/Rakefile +2 -2
- data/exe/tapyrus-script-debugger +5 -5
- data/exe/tapyrusrb-cli +1 -1
- data/exe/tapyrusrbd +18 -17
- data/lib/openassets/payload.rb +2 -2
- data/lib/openassets/util.rb +2 -2
- data/lib/openassets.rb +4 -4
- data/lib/schnorr/sign_to_contract.rb +4 -4
- data/lib/schnorr/signature.rb +5 -5
- data/lib/schnorr.rb +14 -14
- data/lib/tapyrus/base58.rb +8 -8
- data/lib/tapyrus/bip175.rb +5 -5
- data/lib/tapyrus/block_header.rb +2 -2
- data/lib/tapyrus/bloom_filter.rb +1 -1
- data/lib/tapyrus/chain_params.rb +5 -5
- data/lib/tapyrus/constants.rb +1 -1
- data/lib/tapyrus/errors.rb +9 -9
- data/lib/tapyrus/ext/ecdsa.rb +4 -4
- data/lib/tapyrus/ext/json_parser.rb +1 -1
- data/lib/tapyrus/ext.rb +3 -3
- data/lib/tapyrus/ext_key.rb +21 -21
- data/lib/tapyrus/jws.rb +76 -0
- data/lib/tapyrus/key.rb +48 -20
- data/lib/tapyrus/key_path.rb +3 -3
- data/lib/tapyrus/logger.rb +4 -11
- data/lib/tapyrus/merkle_tree.rb +1 -1
- data/lib/tapyrus/message/addr.rb +2 -2
- data/lib/tapyrus/message/base.rb +2 -2
- data/lib/tapyrus/message/block.rb +1 -1
- data/lib/tapyrus/message/block_txn.rb +1 -1
- data/lib/tapyrus/message/cmpct_block.rb +1 -1
- data/lib/tapyrus/message/fee_filter.rb +3 -3
- data/lib/tapyrus/message/filter_add.rb +1 -1
- data/lib/tapyrus/message/filter_clear.rb +2 -2
- data/lib/tapyrus/message/filter_load.rb +7 -7
- data/lib/tapyrus/message/get_addr.rb +2 -2
- data/lib/tapyrus/message/get_block_txn.rb +1 -1
- data/lib/tapyrus/message/get_blocks.rb +1 -1
- data/lib/tapyrus/message/get_data.rb +1 -1
- data/lib/tapyrus/message/get_headers.rb +1 -1
- data/lib/tapyrus/message/header_and_short_ids.rb +6 -6
- data/lib/tapyrus/message/headers.rb +1 -1
- data/lib/tapyrus/message/headers_parser.rb +2 -2
- data/lib/tapyrus/message/inv.rb +1 -1
- data/lib/tapyrus/message/inventory.rb +3 -3
- data/lib/tapyrus/message/mem_pool.rb +2 -2
- data/lib/tapyrus/message/merkle_block.rb +3 -3
- data/lib/tapyrus/message/network_addr.rb +9 -9
- data/lib/tapyrus/message/not_found.rb +1 -1
- data/lib/tapyrus/message/ping.rb +3 -3
- data/lib/tapyrus/message/pong.rb +3 -3
- data/lib/tapyrus/message/reject.rb +6 -6
- data/lib/tapyrus/message/send_cmpct.rb +4 -4
- data/lib/tapyrus/message/send_headers.rb +2 -2
- data/lib/tapyrus/message/tx.rb +1 -1
- data/lib/tapyrus/message/ver_ack.rb +2 -2
- data/lib/tapyrus/message/version.rb +7 -7
- data/lib/tapyrus/message.rb +37 -37
- data/lib/tapyrus/mnemonic.rb +18 -16
- data/lib/tapyrus/network/connection.rb +2 -2
- data/lib/tapyrus/network/message_handler.rb +11 -11
- data/lib/tapyrus/network/peer.rb +1 -1
- data/lib/tapyrus/network/peer_discovery.rb +1 -1
- data/lib/tapyrus/network/pool.rb +4 -4
- data/lib/tapyrus/network.rb +6 -6
- data/lib/tapyrus/node/cli.rb +34 -34
- data/lib/tapyrus/node/configuration.rb +3 -3
- data/lib/tapyrus/node/spv.rb +2 -2
- data/lib/tapyrus/node.rb +3 -3
- data/lib/tapyrus/opcodes.rb +7 -7
- data/lib/tapyrus/out_point.rb +2 -2
- data/lib/tapyrus/rpc/http_server.rb +6 -6
- data/lib/tapyrus/rpc/request_handler.rb +5 -5
- data/lib/tapyrus/rpc/tapyrus_core_client.rb +10 -10
- data/lib/tapyrus/rpc.rb +4 -4
- data/lib/tapyrus/script/color.rb +3 -3
- data/lib/tapyrus/script/debugger.rb +9 -9
- data/lib/tapyrus/script/multisig.rb +2 -2
- data/lib/tapyrus/script/script.rb +28 -28
- data/lib/tapyrus/script/script_error.rb +42 -42
- data/lib/tapyrus/script/script_interpreter.rb +9 -9
- data/lib/tapyrus/script/tx_checker.rb +2 -2
- data/lib/tapyrus/secp256k1/native.rb +23 -23
- data/lib/tapyrus/secp256k1/rfc6979.rb +7 -7
- data/lib/tapyrus/secp256k1/ruby.rb +2 -2
- data/lib/tapyrus/secp256k1.rb +3 -3
- data/lib/tapyrus/slip39/share.rb +7 -7
- data/lib/tapyrus/slip39/sss.rb +24 -24
- data/lib/tapyrus/slip39.rb +514 -37
- data/lib/tapyrus/store/db/level_db.rb +2 -2
- data/lib/tapyrus/store/db.rb +1 -1
- data/lib/tapyrus/store/spv_chain.rb +7 -7
- data/lib/tapyrus/store.rb +3 -3
- data/lib/tapyrus/tip0137.rb +201 -0
- data/lib/tapyrus/tx.rb +12 -12
- data/lib/tapyrus/tx_builder.rb +3 -3
- data/lib/tapyrus/tx_in.rb +3 -3
- data/lib/tapyrus/tx_out.rb +3 -3
- data/lib/tapyrus/util.rb +21 -21
- data/lib/tapyrus/validation.rb +9 -9
- data/lib/tapyrus/version.rb +1 -1
- data/lib/tapyrus/wallet/account.rb +12 -12
- data/lib/tapyrus/wallet/base.rb +9 -8
- data/lib/tapyrus/wallet/db.rb +11 -11
- data/lib/tapyrus/wallet/master_key.rb +13 -13
- data/lib/tapyrus/wallet.rb +4 -4
- data/lib/tapyrus.rb +62 -59
- data/tapyrusrb.gemspec +33 -31
- metadata +30 -14
data/lib/tapyrus/slip39/sss.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "securerandom"
|
2
2
|
|
3
3
|
module Tapyrus
|
4
4
|
module SLIP39
|
@@ -31,33 +31,33 @@ module Tapyrus
|
|
31
31
|
# @param [String] secret master secret with hex format.
|
32
32
|
# @param [String] passphrase the passphrase used for encryption/decryption.
|
33
33
|
# @return [Array[Array[Tapyrus::SLIP39::Share]]] array of group shares.
|
34
|
-
def self.setup_shares(groups: [], group_threshold: nil, exp: 0, secret: nil, passphrase:
|
35
|
-
raise ArgumentError,
|
36
|
-
raise ArgumentError,
|
37
|
-
raise ArgumentError,
|
34
|
+
def self.setup_shares(groups: [], group_threshold: nil, exp: 0, secret: nil, passphrase: "")
|
35
|
+
raise ArgumentError, "Groups is empty." if groups.empty?
|
36
|
+
raise ArgumentError, "Group threshold must be greater than 0." if group_threshold.nil? || group_threshold < 1
|
37
|
+
raise ArgumentError, "Master secret does not specified." unless secret
|
38
38
|
if (secret.htb.bytesize * 8) < MIN_STRENGTH_BITS
|
39
39
|
raise ArgumentError,
|
40
40
|
"The length of the master secret (#{secret.htb.bytesize} bytes) must be at least #{MIN_STRENGTH_BITS / 8} bytes."
|
41
41
|
end
|
42
42
|
unless secret.bytesize.even?
|
43
|
-
raise ArgumentError,
|
43
|
+
raise ArgumentError, "The length of the master secret in bytes must be an even number."
|
44
44
|
end
|
45
45
|
unless passphrase.ascii_only?
|
46
|
-
raise ArgumentError,
|
46
|
+
raise ArgumentError, "The passphrase must contain only printable ASCII characters (code points 32-126)."
|
47
47
|
end
|
48
48
|
if group_threshold > groups.length
|
49
49
|
raise ArgumentError,
|
50
50
|
"The requested group threshold (#{group_threshold}) must not exceed the number of groups (#{groups.length})."
|
51
51
|
end
|
52
52
|
groups.each do |threshold, count|
|
53
|
-
raise ArgumentError,
|
53
|
+
raise ArgumentError, "Group threshold must be greater than 0." if threshold.nil? || threshold < 1
|
54
54
|
if threshold > count
|
55
55
|
raise ArgumentError,
|
56
56
|
"The requested member threshold (#{threshold}) must not exceed the number of share (#{count})."
|
57
57
|
end
|
58
58
|
if threshold == 1 && count > 1
|
59
59
|
raise ArgumentError,
|
60
|
-
|
60
|
+
"Creating multiple member shares with member threshold 1 is not allowed. Use 1-of-1 member sharing instead."
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
@@ -97,8 +97,8 @@ module Tapyrus
|
|
97
97
|
# @param [Array[Tapyrus::SLIP30::Share]] shares an array of shares.
|
98
98
|
# @param [String] passphrase the passphrase using decrypt master secret.
|
99
99
|
# @return [String] a master secret.
|
100
|
-
def self.recover_secret(shares, passphrase:
|
101
|
-
raise ArgumentError,
|
100
|
+
def self.recover_secret(shares, passphrase: "")
|
101
|
+
raise ArgumentError, "share is empty." if shares.nil? || shares.empty?
|
102
102
|
groups = {}
|
103
103
|
id = shares[0].id
|
104
104
|
exp = shares[0].iteration_exp
|
@@ -106,15 +106,15 @@ module Tapyrus
|
|
106
106
|
group_count = shares.first.group_count
|
107
107
|
|
108
108
|
shares.each do |share|
|
109
|
-
raise ArgumentError,
|
109
|
+
raise ArgumentError, "Invalid set of shares. All shares must have the same id." unless id == share.id
|
110
110
|
unless group_threshold == share.group_threshold
|
111
|
-
raise ArgumentError,
|
111
|
+
raise ArgumentError, "Invalid set of shares. All shares must have the same group threshold."
|
112
112
|
end
|
113
113
|
unless group_count == share.group_count
|
114
|
-
raise ArgumentError,
|
114
|
+
raise ArgumentError, "Invalid set of shares. All shares must have the same group count."
|
115
115
|
end
|
116
116
|
unless exp == share.iteration_exp
|
117
|
-
raise ArgumentError,
|
117
|
+
raise ArgumentError, "Invalid set of shares. All Shares must have the same iteration exponent."
|
118
118
|
end
|
119
119
|
groups[share.group_index] ||= []
|
120
120
|
groups[share.group_index] << share
|
@@ -134,16 +134,16 @@ module Tapyrus
|
|
134
134
|
x_coordinates = []
|
135
135
|
shares.each do |share|
|
136
136
|
unless member_threshold == share.member_threshold
|
137
|
-
raise ArgumentError,
|
137
|
+
raise ArgumentError, "Invalid set of shares. All shares in a group must have the same member threshold."
|
138
138
|
end
|
139
139
|
unless value_length == share.value.length
|
140
|
-
raise ArgumentError,
|
140
|
+
raise ArgumentError, "Invalid set of shares. All share values must have the same length."
|
141
141
|
end
|
142
142
|
x_coordinates << share.member_index
|
143
143
|
end
|
144
144
|
x_coordinates.uniq!
|
145
145
|
unless x_coordinates.size == shares.size
|
146
|
-
raise ArgumentError,
|
146
|
+
raise ArgumentError, "Invalid set of shares. Share indices must be unique."
|
147
147
|
end
|
148
148
|
interpolate_shares = shares.map { |s| [s.member_index, s.value] }
|
149
149
|
|
@@ -151,7 +151,7 @@ module Tapyrus
|
|
151
151
|
digest_value = interpolate(interpolate_shares, DIGEST_INDEX).htb
|
152
152
|
digest, random_value = digest_value[0...DIGEST_LENGTH_BYTES].bth, digest_value[DIGEST_LENGTH_BYTES..-1].bth
|
153
153
|
recover_digest = create_digest(secret, random_value)
|
154
|
-
raise ArgumentError,
|
154
|
+
raise ArgumentError, "Invalid digest of the shared secret." unless digest == recover_digest
|
155
155
|
|
156
156
|
group_shares[group_index] = secret
|
157
157
|
end
|
@@ -169,7 +169,7 @@ module Tapyrus
|
|
169
169
|
digest_value = interpolate(interpolate_shares, DIGEST_INDEX).htb
|
170
170
|
digest, random_value = digest_value[0...DIGEST_LENGTH_BYTES].bth, digest_value[DIGEST_LENGTH_BYTES..-1].bth
|
171
171
|
recover_digest = create_digest(secret, random_value)
|
172
|
-
raise ArgumentError,
|
172
|
+
raise ArgumentError, "Invalid digest of the shared secret." unless digest == recover_digest
|
173
173
|
|
174
174
|
decrypt(secret, passphrase, exp, id)
|
175
175
|
end
|
@@ -186,7 +186,7 @@ module Tapyrus
|
|
186
186
|
|
187
187
|
log_prod = shares.sum { |s| LOG_TABLE[s[0] ^ x] }
|
188
188
|
|
189
|
-
result = (
|
189
|
+
result = ("00" * shares.first[1].length).htb
|
190
190
|
shares.each do |share|
|
191
191
|
log_basis_eval = (log_prod - LOG_TABLE[share[0] ^ x] - shares.sum { |s| LOG_TABLE[share[0] ^ s[0]] }) % 255
|
192
192
|
result =
|
@@ -213,7 +213,7 @@ module Tapyrus
|
|
213
213
|
salt = get_salt(id)
|
214
214
|
e = (Tapyrus::SLIP39::BASE_ITERATION_COUNT << exp) / Tapyrus::SLIP39::ROUND_COUNT
|
215
215
|
Tapyrus::SLIP39::ROUND_COUNT.times.to_a.reverse.each do |i|
|
216
|
-
f = OpenSSL::PKCS5.pbkdf2_hmac((i.itb + passphrase), salt + r, e, r.bytesize,
|
216
|
+
f = OpenSSL::PKCS5.pbkdf2_hmac((i.itb + passphrase), salt + r, e, r.bytesize, "sha256")
|
217
217
|
l, r = padding_zero(r, r.bytesize), padding_zero((l.bti ^ f.bti).itb, r.bytesize)
|
218
218
|
end
|
219
219
|
(r + l).bth
|
@@ -231,7 +231,7 @@ module Tapyrus
|
|
231
231
|
salt = get_salt(id)
|
232
232
|
e = (Tapyrus::SLIP39::BASE_ITERATION_COUNT << exp) / Tapyrus::SLIP39::ROUND_COUNT
|
233
233
|
Tapyrus::SLIP39::ROUND_COUNT.times.to_a.each do |i|
|
234
|
-
f = OpenSSL::PKCS5.pbkdf2_hmac((i.itb + passphrase), salt + r, e, r.bytesize,
|
234
|
+
f = OpenSSL::PKCS5.pbkdf2_hmac((i.itb + passphrase), salt + r, e, r.bytesize, "sha256")
|
235
235
|
l, r = padding_zero(r, r.bytesize), padding_zero((l.bti ^ f.bti).itb, r.bytesize)
|
236
236
|
end
|
237
237
|
(r + l).bth
|
@@ -250,7 +250,7 @@ module Tapyrus
|
|
250
250
|
# @param [Integer] id id
|
251
251
|
# @return [String] salt with binary format.
|
252
252
|
def self.get_salt(id)
|
253
|
-
(Tapyrus::SLIP39::CUSTOMIZATION_STRING.pack(
|
253
|
+
(Tapyrus::SLIP39::CUSTOMIZATION_STRING.pack("c*") + id.itb)
|
254
254
|
end
|
255
255
|
|
256
256
|
# Split the share into +count+ with threshold +threshold+.
|
data/lib/tapyrus/slip39.rb
CHANGED
@@ -37,7 +37,7 @@ module Tapyrus
|
|
37
37
|
DIGEST_LENGTH_BYTES = 4
|
38
38
|
|
39
39
|
# The customization string used in the RS1024 checksum and in the PBKDF2 salt.
|
40
|
-
CUSTOMIZATION_STRING =
|
40
|
+
CUSTOMIZATION_STRING = "shamir".bytes
|
41
41
|
|
42
42
|
# The length of the mnemonic in words without the share value.
|
43
43
|
METADATA_LENGTH_WORDS = ID_EXP_LENGTH_WORDS + 2 + CHECKSUM_LENGTH_WORDS
|
@@ -62,47 +62,524 @@ module Tapyrus
|
|
62
62
|
|
63
63
|
# prettier-ignore
|
64
64
|
EXP_TABLE = [
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
65
|
+
1,
|
66
|
+
3,
|
67
|
+
5,
|
68
|
+
15,
|
69
|
+
17,
|
70
|
+
51,
|
71
|
+
85,
|
72
|
+
255,
|
73
|
+
26,
|
74
|
+
46,
|
75
|
+
114,
|
76
|
+
150,
|
77
|
+
161,
|
78
|
+
248,
|
79
|
+
19,
|
80
|
+
53,
|
81
|
+
95,
|
82
|
+
225,
|
83
|
+
56,
|
84
|
+
72,
|
85
|
+
216,
|
86
|
+
115,
|
87
|
+
149,
|
88
|
+
164,
|
89
|
+
247,
|
90
|
+
2,
|
91
|
+
6,
|
92
|
+
10,
|
93
|
+
30,
|
94
|
+
34,
|
95
|
+
102,
|
96
|
+
170,
|
97
|
+
229,
|
98
|
+
52,
|
99
|
+
92,
|
100
|
+
228,
|
101
|
+
55,
|
102
|
+
89,
|
103
|
+
235,
|
104
|
+
38,
|
105
|
+
106,
|
106
|
+
190,
|
107
|
+
217,
|
108
|
+
112,
|
109
|
+
144,
|
110
|
+
171,
|
111
|
+
230,
|
112
|
+
49,
|
113
|
+
83,
|
114
|
+
245,
|
115
|
+
4,
|
116
|
+
12,
|
117
|
+
20,
|
118
|
+
60,
|
119
|
+
68,
|
120
|
+
204,
|
121
|
+
79,
|
122
|
+
209,
|
123
|
+
104,
|
124
|
+
184,
|
125
|
+
211,
|
126
|
+
110,
|
127
|
+
178,
|
128
|
+
205,
|
129
|
+
76,
|
130
|
+
212,
|
131
|
+
103,
|
132
|
+
169,
|
133
|
+
224,
|
134
|
+
59,
|
135
|
+
77,
|
136
|
+
215,
|
137
|
+
98,
|
138
|
+
166,
|
139
|
+
241,
|
140
|
+
8,
|
141
|
+
24,
|
142
|
+
40,
|
143
|
+
120,
|
144
|
+
136,
|
145
|
+
131,
|
146
|
+
158,
|
147
|
+
185,
|
148
|
+
208,
|
149
|
+
107,
|
150
|
+
189,
|
151
|
+
220,
|
152
|
+
127,
|
153
|
+
129,
|
154
|
+
152,
|
155
|
+
179,
|
156
|
+
206,
|
157
|
+
73,
|
158
|
+
219,
|
159
|
+
118,
|
160
|
+
154,
|
161
|
+
181,
|
162
|
+
196,
|
163
|
+
87,
|
164
|
+
249,
|
165
|
+
16,
|
166
|
+
48,
|
167
|
+
80,
|
168
|
+
240,
|
169
|
+
11,
|
170
|
+
29,
|
171
|
+
39,
|
172
|
+
105,
|
173
|
+
187,
|
174
|
+
214,
|
175
|
+
97,
|
176
|
+
163,
|
177
|
+
254,
|
178
|
+
25,
|
179
|
+
43,
|
180
|
+
125,
|
181
|
+
135,
|
182
|
+
146,
|
183
|
+
173,
|
184
|
+
236,
|
185
|
+
47,
|
186
|
+
113,
|
187
|
+
147,
|
188
|
+
174,
|
189
|
+
233,
|
190
|
+
32,
|
191
|
+
96,
|
192
|
+
160,
|
193
|
+
251,
|
194
|
+
22,
|
195
|
+
58,
|
196
|
+
78,
|
197
|
+
210,
|
198
|
+
109,
|
199
|
+
183,
|
200
|
+
194,
|
201
|
+
93,
|
202
|
+
231,
|
203
|
+
50,
|
204
|
+
86,
|
205
|
+
250,
|
206
|
+
21,
|
207
|
+
63,
|
208
|
+
65,
|
209
|
+
195,
|
210
|
+
94,
|
211
|
+
226,
|
212
|
+
61,
|
213
|
+
71,
|
214
|
+
201,
|
215
|
+
64,
|
216
|
+
192,
|
217
|
+
91,
|
218
|
+
237,
|
219
|
+
44,
|
220
|
+
116,
|
221
|
+
156,
|
222
|
+
191,
|
223
|
+
218,
|
224
|
+
117,
|
225
|
+
159,
|
226
|
+
186,
|
227
|
+
213,
|
228
|
+
100,
|
229
|
+
172,
|
230
|
+
239,
|
231
|
+
42,
|
232
|
+
126,
|
233
|
+
130,
|
234
|
+
157,
|
235
|
+
188,
|
236
|
+
223,
|
237
|
+
122,
|
238
|
+
142,
|
239
|
+
137,
|
240
|
+
128,
|
241
|
+
155,
|
242
|
+
182,
|
243
|
+
193,
|
244
|
+
88,
|
245
|
+
232,
|
246
|
+
35,
|
247
|
+
101,
|
248
|
+
175,
|
249
|
+
234,
|
250
|
+
37,
|
251
|
+
111,
|
252
|
+
177,
|
253
|
+
200,
|
254
|
+
67,
|
255
|
+
197,
|
256
|
+
84,
|
257
|
+
252,
|
258
|
+
31,
|
259
|
+
33,
|
260
|
+
99,
|
261
|
+
165,
|
262
|
+
244,
|
263
|
+
7,
|
264
|
+
9,
|
265
|
+
27,
|
266
|
+
45,
|
267
|
+
119,
|
268
|
+
153,
|
269
|
+
176,
|
270
|
+
203,
|
271
|
+
70,
|
272
|
+
202,
|
273
|
+
69,
|
274
|
+
207,
|
275
|
+
74,
|
276
|
+
222,
|
277
|
+
121,
|
278
|
+
139,
|
279
|
+
134,
|
280
|
+
145,
|
281
|
+
168,
|
282
|
+
227,
|
283
|
+
62,
|
284
|
+
66,
|
285
|
+
198,
|
286
|
+
81,
|
287
|
+
243,
|
288
|
+
14,
|
289
|
+
18,
|
290
|
+
54,
|
291
|
+
90,
|
292
|
+
238,
|
293
|
+
41,
|
294
|
+
123,
|
295
|
+
141,
|
296
|
+
140,
|
297
|
+
143,
|
298
|
+
138,
|
299
|
+
133,
|
300
|
+
148,
|
301
|
+
167,
|
302
|
+
242,
|
303
|
+
13,
|
304
|
+
23,
|
305
|
+
57,
|
306
|
+
75,
|
307
|
+
221,
|
308
|
+
124,
|
309
|
+
132,
|
310
|
+
151,
|
311
|
+
162,
|
312
|
+
253,
|
313
|
+
28,
|
314
|
+
36,
|
315
|
+
108,
|
316
|
+
180,
|
317
|
+
199,
|
318
|
+
82,
|
319
|
+
246
|
82
320
|
]
|
83
321
|
|
84
322
|
# prettier-ignore
|
85
323
|
LOG_TABLE = [
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
324
|
+
0,
|
325
|
+
0,
|
326
|
+
25,
|
327
|
+
1,
|
328
|
+
50,
|
329
|
+
2,
|
330
|
+
26,
|
331
|
+
198,
|
332
|
+
75,
|
333
|
+
199,
|
334
|
+
27,
|
335
|
+
104,
|
336
|
+
51,
|
337
|
+
238,
|
338
|
+
223,
|
339
|
+
3,
|
340
|
+
100,
|
341
|
+
4,
|
342
|
+
224,
|
343
|
+
14,
|
344
|
+
52,
|
345
|
+
141,
|
346
|
+
129,
|
347
|
+
239,
|
348
|
+
76,
|
349
|
+
113,
|
350
|
+
8,
|
351
|
+
200,
|
352
|
+
248,
|
353
|
+
105,
|
354
|
+
28,
|
355
|
+
193,
|
356
|
+
125,
|
357
|
+
194,
|
358
|
+
29,
|
359
|
+
181,
|
360
|
+
249,
|
361
|
+
185,
|
362
|
+
39,
|
363
|
+
106,
|
364
|
+
77,
|
365
|
+
228,
|
366
|
+
166,
|
367
|
+
114,
|
368
|
+
154,
|
369
|
+
201,
|
370
|
+
9,
|
371
|
+
120,
|
372
|
+
101,
|
373
|
+
47,
|
374
|
+
138,
|
375
|
+
5,
|
376
|
+
33,
|
377
|
+
15,
|
378
|
+
225,
|
379
|
+
36,
|
380
|
+
18,
|
381
|
+
240,
|
382
|
+
130,
|
383
|
+
69,
|
384
|
+
53,
|
385
|
+
147,
|
386
|
+
218,
|
387
|
+
142,
|
388
|
+
150,
|
389
|
+
143,
|
390
|
+
219,
|
391
|
+
189,
|
392
|
+
54,
|
393
|
+
208,
|
394
|
+
206,
|
395
|
+
148,
|
396
|
+
19,
|
397
|
+
92,
|
398
|
+
210,
|
399
|
+
241,
|
400
|
+
64,
|
401
|
+
70,
|
402
|
+
131,
|
403
|
+
56,
|
404
|
+
102,
|
405
|
+
221,
|
406
|
+
253,
|
407
|
+
48,
|
408
|
+
191,
|
409
|
+
6,
|
410
|
+
139,
|
411
|
+
98,
|
412
|
+
179,
|
413
|
+
37,
|
414
|
+
226,
|
415
|
+
152,
|
416
|
+
34,
|
417
|
+
136,
|
418
|
+
145,
|
419
|
+
16,
|
420
|
+
126,
|
421
|
+
110,
|
422
|
+
72,
|
423
|
+
195,
|
424
|
+
163,
|
425
|
+
182,
|
426
|
+
30,
|
427
|
+
66,
|
428
|
+
58,
|
429
|
+
107,
|
430
|
+
40,
|
431
|
+
84,
|
432
|
+
250,
|
433
|
+
133,
|
434
|
+
61,
|
435
|
+
186,
|
436
|
+
43,
|
437
|
+
121,
|
438
|
+
10,
|
439
|
+
21,
|
440
|
+
155,
|
441
|
+
159,
|
442
|
+
94,
|
443
|
+
202,
|
444
|
+
78,
|
445
|
+
212,
|
446
|
+
172,
|
447
|
+
229,
|
448
|
+
243,
|
449
|
+
115,
|
450
|
+
167,
|
451
|
+
87,
|
452
|
+
175,
|
453
|
+
88,
|
454
|
+
168,
|
455
|
+
80,
|
456
|
+
244,
|
457
|
+
234,
|
458
|
+
214,
|
459
|
+
116,
|
460
|
+
79,
|
461
|
+
174,
|
462
|
+
233,
|
463
|
+
213,
|
464
|
+
231,
|
465
|
+
230,
|
466
|
+
173,
|
467
|
+
232,
|
468
|
+
44,
|
469
|
+
215,
|
470
|
+
117,
|
471
|
+
122,
|
472
|
+
235,
|
473
|
+
22,
|
474
|
+
11,
|
475
|
+
245,
|
476
|
+
89,
|
477
|
+
203,
|
478
|
+
95,
|
479
|
+
176,
|
480
|
+
156,
|
481
|
+
169,
|
482
|
+
81,
|
483
|
+
160,
|
484
|
+
127,
|
485
|
+
12,
|
486
|
+
246,
|
487
|
+
111,
|
488
|
+
23,
|
489
|
+
196,
|
490
|
+
73,
|
491
|
+
236,
|
492
|
+
216,
|
493
|
+
67,
|
494
|
+
31,
|
495
|
+
45,
|
496
|
+
164,
|
497
|
+
118,
|
498
|
+
123,
|
499
|
+
183,
|
500
|
+
204,
|
501
|
+
187,
|
502
|
+
62,
|
503
|
+
90,
|
504
|
+
251,
|
505
|
+
96,
|
506
|
+
177,
|
507
|
+
134,
|
508
|
+
59,
|
509
|
+
82,
|
510
|
+
161,
|
511
|
+
108,
|
512
|
+
170,
|
513
|
+
85,
|
514
|
+
41,
|
515
|
+
157,
|
516
|
+
151,
|
517
|
+
178,
|
518
|
+
135,
|
519
|
+
144,
|
520
|
+
97,
|
521
|
+
190,
|
522
|
+
220,
|
523
|
+
252,
|
524
|
+
188,
|
525
|
+
149,
|
526
|
+
207,
|
527
|
+
205,
|
528
|
+
55,
|
529
|
+
63,
|
530
|
+
91,
|
531
|
+
209,
|
532
|
+
83,
|
533
|
+
57,
|
534
|
+
132,
|
535
|
+
60,
|
536
|
+
65,
|
537
|
+
162,
|
538
|
+
109,
|
539
|
+
71,
|
540
|
+
20,
|
541
|
+
42,
|
542
|
+
158,
|
543
|
+
93,
|
544
|
+
86,
|
545
|
+
242,
|
546
|
+
211,
|
547
|
+
171,
|
548
|
+
68,
|
549
|
+
17,
|
550
|
+
146,
|
551
|
+
217,
|
552
|
+
35,
|
553
|
+
32,
|
554
|
+
46,
|
555
|
+
137,
|
556
|
+
180,
|
557
|
+
124,
|
558
|
+
184,
|
559
|
+
38,
|
560
|
+
119,
|
561
|
+
153,
|
562
|
+
227,
|
563
|
+
165,
|
564
|
+
103,
|
565
|
+
74,
|
566
|
+
237,
|
567
|
+
222,
|
568
|
+
197,
|
569
|
+
49,
|
570
|
+
254,
|
571
|
+
24,
|
572
|
+
13,
|
573
|
+
99,
|
574
|
+
140,
|
575
|
+
128,
|
576
|
+
192,
|
577
|
+
247,
|
578
|
+
112,
|
579
|
+
7
|
103
580
|
]
|
104
581
|
|
105
|
-
autoload :SSS,
|
106
|
-
autoload :Share,
|
582
|
+
autoload :SSS, "tapyrus/slip39/sss"
|
583
|
+
autoload :Share, "tapyrus/slip39/share"
|
107
584
|
end
|
108
585
|
end
|