Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13115648
D7393.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
690 B
Subscribers
None
D7393.diff
View Options
diff --git a/src/key.h b/src/key.h
--- a/src/key.h
+++ b/src/key.h
@@ -95,6 +95,9 @@
//! 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).
diff --git a/src/key.cpp b/src/key.cpp
--- a/src/key.cpp
+++ b/src/key.cpp
@@ -188,6 +188,11 @@
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;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 1, 11:39 (2 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5187653
Default Alt Text
D7393.diff (690 B)
Attached To
D7393: [backport#14047 1/4] CKey: add method to negate the key
Event Timeline
Log In to Comment