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

Functions to inverse and negate private key, commit with 2 blinding factors #39

Merged
merged 6 commits into from
Feb 27, 2019

Conversation

jaspervdm
Copy link
Contributor

@jaspervdm jaspervdm commented Feb 10, 2019

This PR adds 3 new convenience functions (and corresponding tests):

  • secp256k1_ec_privkey_tweak_inv - inverts the private key (x 🡒 x^(-1))
  • secp256k1_ec_privkey_tweak_neg - negates the private key (x 🡒 -x)
  • secp256k1_pedersen_blind_commit - pedersen commitment with 2 blinding factors instead of blinding factor and u64

src/tests.c Show resolved Hide resolved
@garyyu
Copy link
Contributor

garyyu commented Feb 15, 2019

And you also add secp256k1_pedersen_blind_commit function in this PR.
What's it for?

@jaspervdm
Copy link
Contributor Author

Yeah haven't updated the PR description yet, will do soon. It is to calculate commitment x*G + v*H where v is a secret key instead of a 64 bit integer

@jaspervdm jaspervdm changed the title Functions to inverse and negate private key Functions to inverse and negate private key, commit with 2 blinding factors Feb 15, 2019
@jaspervdm
Copy link
Contributor Author

I added some tests for the secp256k1_pedersen_blind_commit function, the PR is ready for final review!

@ignopeverell
Copy link
Contributor

Could you provide some general direction as to what those could be used for?

@antiochp
Copy link
Member

@jaspervdm doing some secret dev work by the looks of it.

@jaspervdm
Copy link
Contributor Author

These 3 methods are useful in a secret sharing scheme. In particular, the inverse and negate functions are used in calculations for Lagrange basis polynomials.

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.

4 participants