2016-10-24 13:44:49 +00:00
|
|
|
|
2017-04-08 16:43:26 +00:00
|
|
|
# extmod/modtrezorcrypto/modtrezorcrypto-curve25519.h
|
2016-10-24 13:44:49 +00:00
|
|
|
def generate_secret() -> bytes:
|
|
|
|
'''
|
|
|
|
Generate secret key.
|
|
|
|
'''
|
|
|
|
|
2017-04-08 16:43:26 +00:00
|
|
|
# extmod/modtrezorcrypto/modtrezorcrypto-curve25519.h
|
2016-10-24 13:44:49 +00:00
|
|
|
def publickey(secret_key: bytes) -> bytes:
|
|
|
|
'''
|
|
|
|
Computes public key from secret key.
|
|
|
|
'''
|
|
|
|
|
2017-04-08 16:43:26 +00:00
|
|
|
# extmod/modtrezorcrypto/modtrezorcrypto-curve25519.h
|
2016-10-24 13:44:49 +00:00
|
|
|
def multiply(secret_key: bytes, public_key: bytes) -> bytes:
|
|
|
|
'''
|
|
|
|
Multiplies point defined by public_key with scalar defined by secret_key
|
|
|
|
Useful for ECDH
|
|
|
|
'''
|