2017-09-29 15:31:59 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
|
|
|
import binascii
|
2017-10-01 14:26:51 +00:00
|
|
|
import ed25519raw
|
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):
|
|
|
|
return '"\\x' + '\\x'.join([s[i:i + 2] for i in range(0, len(s), 2)]) + '"'
|
|
|
|
|
2017-10-01 17:52:43 +00:00
|
|
|
|
2017-09-29 15:31:59 +00:00
|
|
|
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))
|
2017-10-01 14:26:51 +00:00
|
|
|
pubkey = ed25519raw.publickey(seckey)
|
2017-09-29 15:31:59 +00:00
|
|
|
pubkey_hex = binascii.hexlify(pubkey).decode()
|
|
|
|
print('pubkey', pubkey_hex)
|
|
|
|
print(' ', hex_to_c(pubkey_hex))
|