mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-12 11:19:08 -05:00
CKey: add method to negate the key
This commit is contained in:
parent
848ec5603f
commit
463921bb64
2 changed files with 9 additions and 0 deletions
|
@ -163,6 +163,12 @@ void CKey::MakeNewKey(bool fCompressedIn) {
|
||||||
fCompressed = fCompressedIn;
|
fCompressed = fCompressedIn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CKey::Negate()
|
||||||
|
{
|
||||||
|
assert(fValid);
|
||||||
|
return secp256k1_ec_privkey_negate(secp256k1_context_sign, keydata.data());
|
||||||
|
}
|
||||||
|
|
||||||
CPrivKey CKey::GetPrivKey() const {
|
CPrivKey CKey::GetPrivKey() const {
|
||||||
assert(fValid);
|
assert(fValid);
|
||||||
CPrivKey privkey;
|
CPrivKey privkey;
|
||||||
|
|
|
@ -98,6 +98,9 @@ public:
|
||||||
//! Generate a new private key using a cryptographic PRNG.
|
//! Generate a new private key using a cryptographic PRNG.
|
||||||
void MakeNewKey(bool fCompressed);
|
void MakeNewKey(bool fCompressed);
|
||||||
|
|
||||||
|
//! Negate private key
|
||||||
|
bool Negate();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert the private key to a CPrivKey (serialized OpenSSL private key data).
|
* Convert the private key to a CPrivKey (serialized OpenSSL private key data).
|
||||||
* This is expensive.
|
* This is expensive.
|
||||||
|
|
Loading…
Add table
Reference in a new issue