Skip to content

Commit 37671ae

Browse files
committed
add information about algorithm to generated files
1 parent a0faa6a commit 37671ae

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

python/ui_controller.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,8 @@ def load_public_info_dynamic(self):
270270
self.gridLayoutWidget_dyn_reconstr)
271271

272272
self.textBrowser_dyn.append(
273-
'Public info loaded. There are {} secrets.'.format(
274-
self.secret_count))
273+
'Public info loaded. There are {} secrets.\nThe algorithm is {}.'.format(
274+
self.secret_count, self.public_info['algorithm']))
275275
for secret, group in enumerate(access_structure):
276276
self.textBrowser_dyn.append(
277277
'Secret {} can be obtained by {}.'.format(secret, str(group)))
@@ -299,7 +299,8 @@ def save_pseudo_shares_to_file(self, dealer):
299299
# TODO: add timestamps and FileChooser dialogs
300300
public_info = {'prime': dealer.p,
301301
'access_structures': dealer.access_structures,
302-
'public_shares_M': dealer.public_shares_M}
302+
'public_shares_M': dealer.public_shares_M,
303+
'algorithm': self.algorithm}
303304

304305
public_info_json_string = jsonpickle.encode(public_info)
305306
with open('public_info.json', 'w') as public_info_file:
@@ -330,6 +331,7 @@ def load_public_reconstruction_info(self):
330331
return
331332

332333
self.public_info = jsonpickle.decode(json_string)
334+
self.algorithm = self.public_info['algorithm']
333335
print('loaded data from JSON', self.public_info)
334336

335337
def load_pseudo_shares_from_user(self, participant):
@@ -377,7 +379,7 @@ def combine_secret(self):
377379
print('Wrong algorithm, cannot combine.')
378380
return
379381

380-
print('Combine secret using', self.algorithm)
382+
self.textBrowser_dyn.append('Combine secret using {} algorithm.'.format(self.algorithm))
381383
combiner.public_shares_M = self.public_info['public_shares_M']
382384
except AttributeError as e:
383385
print('caught error %r' % e)

0 commit comments

Comments
 (0)