Add gen_path_keys function:

pull/79/head
tuxxy 2017-10-13 15:18:52 -06:00
parent 529c5aac85
commit c8b7459e66
No known key found for this signature in database
GPG Key ID: 7BB971A0E89144D9
1 changed files with 19 additions and 1 deletions

View File

@ -207,7 +207,7 @@ class EncryptingPower(CryptoPowerUp):
def encrypt(
self,
data: bytes,
pubkey: bytes
pubkey: bytes,
) -> Tuple[bytes, bytes]:
"""
Encrypts data with Public key encryption
@ -224,6 +224,24 @@ class EncryptingPower(CryptoPowerUp):
return (API.elliptic_curve.serialize(enc_key.ekey), enc_data)
def gen_path_keys(
self,
path: bytes
) -> List[Tuple[bytes, bytes]]:
"""
Generates path keys and returns path keys
:param path: Path to derive key(s) from
:return: List of path keys
"""
subpaths = self._split_path(path)
keys = []
for subpath in subpaths:
path_priv, path_pub = self._derive_path_key(subpath)
keys.append((path_priv, path_pub))
return keys
def encrypt(
self,
data: bytes,