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

Add VRF algorithm in crypto #491

Closed
wants to merge 4 commits into from
Closed

Conversation

NoelBright
Copy link
Contributor

Proposed changes in this pull request

Add VRF algorithm in crypto.
Update SigChain and SigChainElem proto structure.
Use new sigchain to relay message.

Type (put an x where ever applicable)

  • Bug fix: Link to the issue
  • Feature (Non-breaking change)
  • Feature (Breaking change)
  • Documentation Improvement

Checklist

Please put an x against the checkboxes. Write a small comment explaining if its N/A (not applicable)

  • Read the CONTRIBUTION guidelines.
  • All the tests are passing after the introduction of new changes.
  • Added tests respective to the part of code I have written.
  • Added proper documentation where ever applicable (in code and README.md).
  • Code has been written according to NKN-Golang-Style-Guide

Extra information

Any extra information related to this pull request.

Signed-off-by: NoelBright <noel.n.bright@gmail.com>
add 'Proof' member in SigChainElem.

Signed-off-by: NoelBright <noel.n.bright@gmail.com>
Signed-off-by: NoelBright <noel.n.bright@gmail.com>
pb/sigchain.go Outdated
if err != nil {
return nil, err
}
signature, proof := crypto.GenerateVrf(srcPrivKey, hash[:])
Copy link
Member

Choose a reason for hiding this comment

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

since there is no error returned, what if srcPrivKey is invalid?

Copy link
Contributor Author

@NoelBright NoelBright Apr 26, 2019

Choose a reason for hiding this comment

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

Only need to be 64 bytes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Member

@yilunzhang yilunzhang left a comment

Choose a reason for hiding this comment

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

Looks good to me except for the small comment I made

Add returncode err in GenerateVrf

Signed-off-by: NoelBright <noel.n.bright@gmail.com>
@NoelBright NoelBright changed the title V0.9 Add VRF algorithm in crypto Apr 26, 2019
Copy link
Member

@yilunzhang yilunzhang left a comment

Choose a reason for hiding this comment

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

Looks good to me. Have we tested this already?

@NoelBright
Copy link
Contributor Author

Yes, it has passed my test already.

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.

2 participants