Implements a key derivation scheme and a fixed seed key generation #155
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix #154
This PR:
--seed
option tomlar keygen
to deterministically generate keypairmlar keyderive
to derive key along a hierarchical path, ie. to build key-treeNotes on the implementation (the algorithm detail is in the PR):
seed
is a string used to seed the ChaCha-20 PRNG already used to generate keypairs. A SHA-512 is used to convert the input seed to the expected format. Only 32 bytes is needed, but using this scheme, extra bytes are provided for a potential future useHKDF
with the same idea: the HKDF function is used to create a seed, feed in the ChaCha-20 to create a new keypair. The ChaCha-20 might not be useful here, but it adds a layer of irreversibility and simplifies the implementation