17#elif defined(__FreeBSD__)
25namespace fc {
namespace em {
69 static const private_key_secret empty_priv;
76 size_t serialized_result_sz =
sizeof(serialized_result);
78 FC_ASSERT( serialized_result_sz ==
sizeof(serialized_result) );
105 return my->_key != empty_pub;
122 const char* front = &dat.
data[0];
126 EC_KEY *key = EC_KEY_new_by_curve_name( NID_secp256k1 );
127 key = o2i_ECPublicKey( &key, (
const unsigned char**)&front,
sizeof(dat) );
129 EC_KEY_set_conv_form( key, POINT_CONVERSION_COMPRESSED );
130 unsigned char* buffer = (
unsigned char*) my->_key.begin();
131 i2o_ECPublicKey( key, &buffer );
147 if( check_canonical )
149 FC_ASSERT( is_canonical( c ),
"signature is not canonical" );
158 size_t serialized_result_sz = my->_key.size();
160 FC_ASSERT( serialized_result_sz == my->_key.size() );
165 if (nV < 27 || nV >= 35) {
169 if (check_canonical) {
170 FC_ASSERT(is_canonical(c),
"signature is not canonical");
181 (
unsigned char*)c.
begin() + 1,
182 (*c.
begin() - 27) & 3));
192 size_t serialized_result_sz = my->_key.size();
195 (
unsigned char*)&my->_key.data,
196 &serialized_result_sz,
201 FC_ASSERT(serialized_result_sz == my->_key.size());
public_key_impl(const public_key_impl &cpy) BOOST_NOEXCEPT
public_key_impl() BOOST_NOEXCEPT
fc::sha512 get_shared_secret(const public_key &pub) const
contains only the public point of an elliptic curve key.
std::string to_base58() const
Allows to convert current public key object into base58 number.
public_key & operator=(public_key &&pk)
public_key_data serialize() const
Used to generate a useful error report when an exception is thrown.
const char * data() const
static sha512 hash(const char *d, uint32_t dlen)
Defines exception's used by fc.
#define FC_THROW_EXCEPTION(EXCEPTION, FORMAT,...)
#define FC_ASSERT(TEST,...)
Checks a condition and throws an assert_exception if the test is FALSE.
const secp256k1_context * _get_context()
const private_key_secret & get_curve_order()
const ec_group & get_curve()
chr37 _derive_message(const public_key_data &key, int i)
fc::sha256 _left(const fc::sha512 &v)
fc::array< char, 37 > chr37
fc::sha256 _right(const fc::sha512 &v)
const private_key_secret & get_half_curve_order()
fc::sha256 digest(const T &value)
#define SECP256K1_CONTEXT_SIGN
SECP256K1_API int secp256k1_ec_pubkey_serialize(const secp256k1_context *ctx, unsigned char *output, size_t *outputlen, const secp256k1_pubkey *pubkey, unsigned int flags) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4)
SECP256K1_API secp256k1_context * secp256k1_context_create(unsigned int flags) SECP256K1_WARN_UNUSED_RESULT
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_parse(const secp256k1_context *ctx, secp256k1_pubkey *pubkey, const unsigned char *input, size_t inputlen) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
#define SECP256K1_EC_COMPRESSED
#define SECP256K1_CONTEXT_VERIFY
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_tweak_mul(const secp256k1_context *ctx, secp256k1_pubkey *pubkey, const unsigned char *tweak32) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
SECP256K1_API int secp256k1_ecdsa_recoverable_signature_parse_compact(const secp256k1_context *ctx, secp256k1_ecdsa_recoverable_signature *sig, const unsigned char *input64, int recid) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdsa_recover(const secp256k1_context *ctx, secp256k1_pubkey *pubkey, const secp256k1_ecdsa_recoverable_signature *sig, const unsigned char *msghash32) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4)