PRCYCoin  2.0.0.7rc1
P2P Digital Currency
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
CECKey Class Reference

RAII Wrapper around OpenSSL's EC_KEY. More...

#include <ecwrapper.h>

Public Member Functions

 CECKey ()
 
 ~CECKey ()
 
void GetPubKey (std::vector< unsigned char > &pubkey, bool fCompressed)
 
bool SetPubKey (const unsigned char *pubkey, size_t size)
 
bool Verify (const uint256 &hash, const std::vector< unsigned char > &vchSig)
 
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 verifying it. More...
 
bool TweakPublic (const unsigned char vchTweak[32])
 

Static Public Member Functions

static bool SanityCheck ()
 

Private Attributes

EC_KEY * pkey
 

Detailed Description

RAII Wrapper around OpenSSL's EC_KEY.

Definition at line 16 of file ecwrapper.h.

Constructor & Destructor Documentation

◆ CECKey()

CECKey::CECKey ( )

Definition at line 173 of file ecwrapper.cpp.

◆ ~CECKey()

CECKey::~CECKey ( )

Definition at line 179 of file ecwrapper.cpp.

Member Function Documentation

◆ GetPubKey()

void CECKey::GetPubKey ( std::vector< unsigned char > &  pubkey,
bool  fCompressed 
)

Definition at line 184 of file ecwrapper.cpp.

◆ Recover()

bool CECKey::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 verifying it.

If this function succeeds, the recovered public key is guaranteed to be valid (the signature is a valid signature of the given data for that key)

Definition at line 233 of file ecwrapper.cpp.

◆ SanityCheck()

bool CECKey::SanityCheck ( )
static
Todo:
Is there more EC functionality that could be missing?

Definition at line 282 of file ecwrapper.cpp.

Here is the caller graph for this function:

◆ SetPubKey()

bool CECKey::SetPubKey ( const unsigned char *  pubkey,
size_t  size 
)

Definition at line 197 of file ecwrapper.cpp.

◆ TweakPublic()

bool CECKey::TweakPublic ( const unsigned char  vchTweak[32])

Definition at line 257 of file ecwrapper.cpp.

◆ Verify()

bool CECKey::Verify ( const uint256 hash,
const std::vector< unsigned char > &  vchSig 
)

Definition at line 202 of file ecwrapper.cpp.

Member Data Documentation

◆ pkey

EC_KEY* CECKey::pkey
private

Definition at line 19 of file ecwrapper.h.


The documentation for this class was generated from the following files: