mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-12 00:10:58 +00:00
keyctl: show digest and path
This commit is contained in:
parent
7d0a12c29e
commit
01356bad72
@ -44,7 +44,9 @@ def commit(index, filename, seckey):
|
|||||||
_, R = ed25519cosi.get_nonce(sk, digest, ctr)
|
_, R = ed25519cosi.get_nonce(sk, digest, ctr)
|
||||||
else:
|
else:
|
||||||
t = get_trezor()
|
t = get_trezor()
|
||||||
commit = t.cosi_commit(t.expand_path("10018'/%d'" % index), digest)
|
path = "10018'/%d'" % index
|
||||||
|
print('commiting to hash %s with path %s' % (binascii.hexlify(digest).decode(), path))
|
||||||
|
commit = t.cosi_commit(t.expand_path(path), digest)
|
||||||
pk = commit.pubkey
|
pk = commit.pubkey
|
||||||
R = commit.commitment
|
R = commit.commitment
|
||||||
print('%s+%s' % (binascii.hexlify(pk).decode(), binascii.hexlify(R).decode()))
|
print('%s+%s' % (binascii.hexlify(pk).decode(), binascii.hexlify(R).decode()))
|
||||||
@ -86,7 +88,9 @@ def sign(index, filename, global_commit, seckey):
|
|||||||
sig = ed25519raw.encodeint(S)
|
sig = ed25519raw.encodeint(S)
|
||||||
else:
|
else:
|
||||||
t = get_trezor()
|
t = get_trezor()
|
||||||
signature = t.cosi_sign(t.expand_path("10018'/%d'" % index), digest, global_R, global_pk)
|
path = "10018'/%d'" % index
|
||||||
|
print('signing hash %s with path %s' % (binascii.hexlify(digest).decode(), path))
|
||||||
|
signature = t.cosi_sign(t.expand_path(path), digest, global_R, global_pk)
|
||||||
sig = signature.signature
|
sig = signature.signature
|
||||||
print(binascii.hexlify(sig).decode())
|
print(binascii.hexlify(sig).decode())
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user