diff options
| author | Jonas Schnelli <[email protected]> | 2018-08-13 20:18:25 +0200 |
|---|---|---|
| committer | Jonas Schnelli <[email protected]> | 2019-03-27 13:59:50 +0100 |
| commit | 463921bb649d644f79f9d7f0f96f10aa0d165f76 (patch) | |
| tree | 9965daf6e7b984d4435e390d2f5faf67e7644a1f /src | |
| parent | Merge #15643: contrib: gh-merge: Include ACKs in merge commit (diff) | |
| download | discoin-463921bb649d644f79f9d7f0f96f10aa0d165f76.tar.xz discoin-463921bb649d644f79f9d7f0f96f10aa0d165f76.zip | |
CKey: add method to negate the key
Diffstat (limited to 'src')
| -rw-r--r-- | src/key.cpp | 6 | ||||
| -rw-r--r-- | src/key.h | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/key.cpp b/src/key.cpp index 9d982fc44..c17f6a0ae 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -163,6 +163,12 @@ void CKey::MakeNewKey(bool fCompressedIn) { fCompressed = fCompressedIn; } +bool CKey::Negate() +{ + assert(fValid); + return secp256k1_ec_privkey_negate(secp256k1_context_sign, keydata.data()); +} + CPrivKey CKey::GetPrivKey() const { assert(fValid); CPrivKey privkey; @@ -98,6 +98,9 @@ public: //! Generate a new private key using a cryptographic PRNG. void MakeNewKey(bool fCompressed); + //! Negate private key + bool Negate(); + /** * Convert the private key to a CPrivKey (serialized OpenSSL private key data). * This is expensive. |