mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-22 22:38:08 +00:00
tools: add more verbose output to keyctl-coordinator
This commit is contained in:
parent
ecf2dc19ec
commit
de2178a1e9
@ -52,23 +52,26 @@ def sign(index, filename, participants):
|
|||||||
proxy.append(Pyro4.Proxy(uri))
|
proxy.append(Pyro4.Proxy(uri))
|
||||||
# collect commits
|
# collect commits
|
||||||
pks, Rs = [], []
|
pks, Rs = [], []
|
||||||
for p in proxy:
|
for i, p in enumerate(proxy):
|
||||||
pk, R = p.get_commit(index, digest)
|
pk, R = p.get_commit(index, digest)
|
||||||
pk, R = serpent.tobytes(pk), serpent.tobytes(R)
|
pk, R = serpent.tobytes(pk), serpent.tobytes(R)
|
||||||
pks.append(pk)
|
pks.append(pk)
|
||||||
Rs.append(R)
|
Rs.append(R)
|
||||||
|
print('collected commit #%d from %s' % (i, p._pyroUri.host))
|
||||||
# compute global commit
|
# compute global commit
|
||||||
global_pk = cosi.combine_keys(pks)
|
global_pk = cosi.combine_keys(pks)
|
||||||
global_R = cosi.combine_keys(Rs)
|
global_R = cosi.combine_keys(Rs)
|
||||||
# collect signatures
|
# collect signatures
|
||||||
sigs = []
|
sigs = []
|
||||||
for p in proxy:
|
for i, p in enumerate(proxy):
|
||||||
sig = p.get_signature(index, digest, global_R, global_pk)
|
sig = p.get_signature(index, digest, global_R, global_pk)
|
||||||
sig = serpent.tobytes(sig)
|
sig = serpent.tobytes(sig)
|
||||||
sigs.append(sig)
|
sigs.append(sig)
|
||||||
|
print('collected signature #%d from %s' % (i, p._pyroUri.host))
|
||||||
# compute global signature
|
# compute global signature
|
||||||
sig = cosi.combine_sig(global_R, sigs)
|
sig = cosi.combine_sig(global_R, sigs)
|
||||||
cosi.verify(sig, digest, global_pk)
|
cosi.verify(sig, digest, global_pk)
|
||||||
|
print('global signature:')
|
||||||
print(binascii.hexlify(sig).decode())
|
print(binascii.hexlify(sig).decode())
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user