Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F10907647
ecwrapper.h
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
ecwrapper.h
View Options
// Copyright (c) 2009-2014 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_ECWRAPPER_H
#define BITCOIN_ECWRAPPER_H
#include
<cstddef>
#include
<vector>
#include
<openssl/ec.h>
class
uint256
;
/** RAII Wrapper around OpenSSL's EC_KEY */
class
CECKey
{
private
:
EC_KEY
*
pkey
;
public
:
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
);
/**
* 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)
*/
bool
Recover
(
const
uint256
&
hash
,
const
unsigned
char
*
p64
,
int
rec
);
bool
TweakPublic
(
const
unsigned
char
vchTweak
[
32
]);
static
bool
SanityCheck
();
};
#endif
// BITCOIN_ECWRAPPER_H
File Metadata
Details
Attached
Mime Type
text/x-c++
Expires
Mon, Nov 25, 08:08 (1 d, 19 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4514926
Default Alt Text
ecwrapper.h (1 KB)
Attached To
rSTAGING Bitcoin ABC staging
Event Timeline
Log In to Comment