2017-09-29 15:31:59 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
|
|
|
import binascii
|
2022-10-11 08:43:20 +00:00
|
|
|
from trezorlib import _ed25519
|
2017-09-29 15:31:59 +00:00
|
|
|
|
2017-10-01 17:52:43 +00:00
|
|
|
|
2017-09-29 15:31:59 +00:00
|
|
|
def hex_to_c(s):
|
2018-07-31 09:35:09 +00:00
|
|
|
return '"\\x' + "\\x".join([s[i : i + 2] for i in range(0, len(s), 2)]) + '"'
|
2017-09-29 15:31:59 +00:00
|
|
|
|
2017-10-01 17:52:43 +00:00
|
|
|
|
2018-07-31 09:35:09 +00:00
|
|
|
for c in "ABCDEFGHI":
|
2017-09-29 15:31:59 +00:00
|
|
|
print()
|
|
|
|
seckey = c.encode() * 32
|
|
|
|
seckey_hex = binascii.hexlify(seckey).decode()
|
2018-07-31 09:35:09 +00:00
|
|
|
print("seckey", seckey_hex)
|
|
|
|
print(" ", hex_to_c(seckey_hex))
|
2022-10-11 08:43:20 +00:00
|
|
|
pubkey = _ed25519.publickey_unsafe(seckey)
|
2017-09-29 15:31:59 +00:00
|
|
|
pubkey_hex = binascii.hexlify(pubkey).decode()
|
2018-07-31 09:35:09 +00:00
|
|
|
print("pubkey", pubkey_hex)
|
|
|
|
print(" ", hex_to_c(pubkey_hex))
|