Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crypto: update keytool to generate NodeConfig #4769

Merged
merged 1 commit into from
Sep 27, 2022
Merged

crypto: update keytool to generate NodeConfig #4769

merged 1 commit into from
Sep 27, 2022

Conversation

joyqvq
Copy link
Contributor

@joyqvq joyqvq commented Sep 23, 2022

target/debug/sui keytool generate bls12381
target/debug/sui keytool load-keypair bls-0x24fbce9512906c15cdf365feadbfed8464a93416.key
Protocol Keypair: WVAQ4wPlcDrbl2ldtFlAmmAFw4JKl16VE8VA28zNQsqDuxuJPvxRL1Mdf6EAhgY+2H7THQQL0UDCSvykpKIf/xU11SLyPDrz2nKr6N0nVwQYcJLlZWZLUloxn7R+4zvuzU+Dbt8M0ofu3Uxdlway4/Y18MrNwOvrxqWruMxsaNc=
target/debug/sui keytool generate ed25519
target/debug/sui keytool load-keypair 0x3de3f70ca167dd1d611778d7da282c5c6ebccfe5.key
Account Keypair: AEp0ggg5sVrm0kACB63cWRnYFnS+hxeg8Va1ovcvp4vTeJxwbxnlwdfl0AMXgvLLmE4KNkQrmh4V9ijYA3aq4m4=
Network Keypair: eJxwbxnlwdfl0AMXgvLLmE4KNkQrmh4V9ijYA3aq4m5KdIIIObFa5tJAAget3FkZ2BZ0vocXoPFWtaL3L6eL0w==
Worker Keypair: eJxwbxnlwdfl0AMXgvLLmE4KNkQrmh4V9ijYA3aq4m5KdIIIObFa5tJAAget3FkZ2BZ0vocXoPFWtaL3L6eL0w==

verified length:

>>> len(base64.b64decode('WVAQ4wPlcDrbl2ldtFlAmmAFw4JKl16VE8VA28zNQsqDuxuJPvxRL1Mdf6EAhgY+2H7THQQL0UDCSvykpKIf/xU11SLyPDrz2nKr6N0nVwQYcJLlZWZLUloxn7R+4zvuzU+Dbt8M0ofu3Uxdlway4/Y18MrNwOvrxqWruMxsaNc='))
128
>>> len(base64.b64decode('AEp0ggg5sVrm0kACB63cWRnYFnS+hxeg8Va1ovcvp4vTeJxwbxnlwdfl0AMXgvLLmE4KNkQrmh4V9ijYA3aq4m4='))
65
>>> len(base64.b64decode('eJxwbxnlwdfl0AMXgvLLmE4KNkQrmh4V9ijYA3aq4m5KdIIIObFa5tJAAget3FkZ2BZ0vocXoPFWtaL3L6eL0w=='))
64

Copy link
Collaborator

@kchalkias kchalkias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving with an extra comment for reconsidering key encoding alignment even between different key purposes. The more we divert, the more work we need to do to educate people + debug.

Ok(keypair) => {
// Account keypair is encoded with the key scheme flag {},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we prefer not storing the flag for anything apart from account keys? Atm it makes sense as we don't provide crypto agility in these operations, we might however want to reconsider this in the future to have some consistency re key management.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed, left it because this involves adding BLS to enum, therefore to all switch clause on key types. it is quite a large change that i decide to leave out, but worth a revisit to add them eventually.

@joyqvq joyqvq merged commit e2c74a4 into main Sep 27, 2022
@joyqvq joyqvq deleted the kp-fix branch September 27, 2022 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants