Asymmetric encryption stubs.
authorCryptoManiac <balthazar.ad@gmail.com>
Thu, 11 Feb 2016 10:10:04 +0000 (02:10 -0800)
committerCryptoManiac <balthazar.ad@gmail.com>
Thu, 11 Feb 2016 10:10:04 +0000 (02:10 -0800)
src/key.cpp
src/key.h

index adafc32..afe63cb 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <openssl/ecdsa.h>
 #include <openssl/obj_mac.h>
+#include <openssl/ssl.h>
 
 #include "key.h"
 #include "base58.h"
@@ -1092,3 +1093,18 @@ bool CMalleableKeyView::CheckKeyVariant(const CPubKey &R, const CPubKey &vchPubK
     return true;
 }
 
+//// Asymmetric encryption
+
+bool CPubKey::EncryptData(const std::vector<unsigned char>& data, std::vector<unsigned char>& encrypted)
+{
+    // TODO
+
+    return true;
+}
+
+bool CKey::DecryptData(const std::vector<unsigned char>& encrypted, std::vector<unsigned char>& data)
+{
+    // TODO
+
+    return true;
+}
index c189090..a3b23fe 100644 (file)
--- a/src/key.h
+++ b/src/key.h
@@ -97,6 +97,9 @@ public:
     std::vector<unsigned char> Raw() const {
         return vchPubKey;
     }
+
+    // Encrypt data
+    bool EncryptData(const std::vector<unsigned char>& data, std::vector<unsigned char>& encrypted);
 };
 
 
@@ -164,6 +167,9 @@ public:
 
     // Reserialize to DER
     static bool ReserealizeSignature(std::vector<unsigned char>& vchSig);
+
+    // Decrypt data
+    bool DecryptData(const std::vector<unsigned char>& encrypted, std::vector<unsigned char>& data);
 };
 
 class CPoint