mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-03 20:11:00 +00:00
20 lines
550 B
Python
Executable File
20 lines
550 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import binascii
|
|
import ed25519
|
|
|
|
def hex_to_c(s):
|
|
return '"\\x' + '\\x'.join([s[i:i + 2] for i in range(0, len(s), 2)]) + '"'
|
|
|
|
for c in 'ABCDEFGHI':
|
|
print()
|
|
seckey = c.encode() * 32
|
|
seckey_hex = binascii.hexlify(seckey).decode()
|
|
print('seckey', seckey_hex)
|
|
print(' ', hex_to_c(seckey_hex))
|
|
sk = ed25519.SigningKey(seckey)
|
|
pubkey = sk.get_verifying_key().to_bytes()
|
|
pubkey_hex = binascii.hexlify(pubkey).decode()
|
|
print('pubkey', pubkey_hex)
|
|
print(' ', hex_to_c(pubkey_hex))
|