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/keys/internal: use crypto/rand.Reader for generating private key #8742

Merged
merged 2 commits into from
Mar 2, 2021
Merged

crypto/keys/internal: use crypto/rand.Reader for generating private key #8742

merged 2 commits into from
Mar 2, 2021

Conversation

cuonglm
Copy link
Contributor

@cuonglm cuonglm commented Mar 2, 2021

Description

genPrivKey rejects invalid fieldelems, so we must use a real reader
instead of the zero reader.

closes: #8741


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

@cuonglm
Copy link
Contributor Author

cuonglm commented Mar 2, 2021

cc @odeke-em

genPrivKey rejects invalid fieldelems, so we must use a real reader
instead of the zero reader.

Fixes #8741
Copy link
Collaborator

@odeke-em odeke-em left a comment

Choose a reason for hiding this comment

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

LGTM, thank you @cuonglm! Good to see you fixed this, it was blocking our work with the benchmarking infrastructure given the indefinite timeout.

@odeke-em odeke-em requested a review from tac0turtle March 2, 2021 09:00
@odeke-em
Copy link
Collaborator

odeke-em commented Mar 2, 2021

Thank you for the review @alessio!

@odeke-em
Copy link
Collaborator

odeke-em commented Mar 2, 2021

Thank you for the review @marbar3778!

@odeke-em odeke-em merged commit a193522 into cosmos:master Mar 2, 2021
@odeke-em odeke-em deleted the cuonglm/fix-benchmark-key-generation branch March 2, 2021 09:56
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.

crypto/keys/secp256k1: BenchmarkKeyGeneration hangs
4 participants