PRCYCoin  2.0.0.7rc1
P2P Digital Currency
ecwrapper.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2014 The Bitcoin developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef BITCOIN_ECWRAPPER_H
6 #define BITCOIN_ECWRAPPER_H
7 
8 #include <cstddef>
9 #include <vector>
10 
11 #include <openssl/ec.h>
12 
13 class uint256;
14 
16 class CECKey
17 {
18 private:
19  EC_KEY* pkey;
20 
21 public:
22  CECKey();
23  ~CECKey();
24 
25  void GetPubKey(std::vector<unsigned char>& pubkey, bool fCompressed);
26  bool SetPubKey(const unsigned char* pubkey, size_t size);
27  bool Verify(const uint256& hash, const std::vector<unsigned char>& vchSig);
28 
35  bool Recover(const uint256& hash, const unsigned char* p64, int rec);
36 
37  bool TweakPublic(const unsigned char vchTweak[32]);
38  static bool SanityCheck();
39 };
40 
41 #endif // BITCOIN_ECWRAPPER_H
CECKey::~CECKey
~CECKey()
Definition: ecwrapper.cpp:179
CECKey::Recover
bool Recover(const uint256 &hash, const unsigned char *p64, int rec)
reconstruct public key from a compact signature This is only slightly more CPU intensive than just ve...
Definition: ecwrapper.cpp:233
CECKey::CECKey
CECKey()
Definition: ecwrapper.cpp:173
CECKey::Verify
bool Verify(const uint256 &hash, const std::vector< unsigned char > &vchSig)
Definition: ecwrapper.cpp:202
CECKey::SetPubKey
bool SetPubKey(const unsigned char *pubkey, size_t size)
Definition: ecwrapper.cpp:197
CECKey::pkey
EC_KEY * pkey
Definition: ecwrapper.h:19
CECKey::GetPubKey
void GetPubKey(std::vector< unsigned char > &pubkey, bool fCompressed)
Definition: ecwrapper.cpp:184
CECKey
RAII Wrapper around OpenSSL's EC_KEY.
Definition: ecwrapper.h:16
uint256
256-bit unsigned big integer.
Definition: uint256.h:38
CECKey::SanityCheck
static bool SanityCheck()
Definition: ecwrapper.cpp:282
CECKey::TweakPublic
bool TweakPublic(const unsigned char vchTweak[32])
Definition: ecwrapper.cpp:257