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 crypto crate to the toolkit #4

Merged
merged 13 commits into from Nov 10, 2020
Merged

Conversation

PumpkinSeed
Copy link
Contributor

Based on the I609 I moved the original content to the crypto crate and make them public based on the pattern of the other crates.

Also changes on my side:

  • Added the verify function to the secp256k1.
  • Add tests for all of the public functions.

Leftover:
I didn't add ed25519 signing however the original ticket contains it. This requires a decision on your part, since I found a crate for that purpose, I would say do it in a different PR.
Also to make it consistent, currently the sign.rs only support secp256k1, I don't know whether we can use the same parameter-set for ed25529, but if yes we can create an enum for decide between algorithms to sign the data.

enum SignAlgorithm {
  Secp256k1
  Ed25519
}

@Cashmaney
Copy link
Member

Thanks @PumpkinSeed! @reuvenpo can you take a look and make sure everything is rusty?

Copy link
Contributor

@reuvenpo reuvenpo left a comment

Choose a reason for hiding this comment

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

You did not export the crypto subcrate from the main secret_toolkit namespace. I'll do it for you real quick

packages/crypto/src/lib.rs Outdated Show resolved Hide resolved
packages/crypto/src/rng.rs Outdated Show resolved Hide resolved
packages/crypto/src/sign.rs Outdated Show resolved Hide resolved
packages/crypto/src/sign.rs Outdated Show resolved Hide resolved
packages/crypto/src/sign.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@reuvenpo reuvenpo left a comment

Choose a reason for hiding this comment

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

awesome PR, thanks @PumpkinSeed :D

@reuvenpo reuvenpo merged commit 444d918 into scrtlabs:master Nov 10, 2020
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

3 participants