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

Change key gen algo #113

Merged
merged 6 commits into from
Nov 19, 2018
Merged

Change key gen algo #113

merged 6 commits into from
Nov 19, 2018

Conversation

NIC619
Copy link
Collaborator

@NIC619 NIC619 commented Nov 17, 2018

What was wrong?

Fix #100
(RSA provided by Go Crypto package prevents deterministic key generation, see: https://github.com/golang/go/blob/6269dcdc24d74379d8a609ce886149811020b2cc/src/crypto/rsa/rsa.go#L223)

How was it fixed?

Was instead trying to remove seed all at once but found that ECDSA provided can do deterministic key generation.

  • Use ECDSA instead of RSA
  • Add RPC call for showing PID

Cute Animal Picture

img_3485

cli.go Outdated
if err != nil {
logger.Fatalf("Failed to request PID from RPC server, err: %v", rpcAddr, err)
}
logger.Debugf("rpcclient:ShowPID: result=%v", res)
Copy link
Collaborator

@mhchia mhchia Nov 18, 2018

Choose a reason for hiding this comment

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

IMO it will be more appropriate to print the result to the stdout

Suggested change
logger.Debugf("rpcclient:ShowPID: result=%v", res)
peerIDStr := marshalToJSONString(res.PID)
fmt.Println(peerIDStr)

pb/rpc/rpc.proto Outdated
message RPCShowPIDRequest {
}
message RPCShowPIDResponse {
string PID = 1;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would you mind follow the convention to use

Suggested change
string PID = 1;
string peerID = 1;

Copy link
Collaborator

@mhchia mhchia left a comment

Choose a reason for hiding this comment

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

LGTM

@NIC619 NIC619 merged commit 5be096d into ethresearch:master Nov 19, 2018
@NIC619 NIC619 mentioned this pull request Nov 28, 2018
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.

Fix the generation process of private key
2 participants