Exemple #1
0
 void signed_block_header::sign( const fc::ecc::private_key& signer, digest_type chain_id )
 { try {
    fc::sha256::encoder enc;
    fc::raw::pack( enc, *this );
    fc::raw::pack( enc, chain_id );
    delegate_signature = signer.sign_compact( digest() );
 } FC_RETHROW_EXCEPTIONS( warn, "" ) }
  void start(const fc::ip::endpoint& endpoint_to_probe, 
             const fc::ecc::private_key& my_node_id,
             const bts::blockchain::digest_type& chain_id)
  {
    fc::future<void> connect_task = fc::async([=](){ _connection->connect_to(endpoint_to_probe); }, "connect_task");
    try
    {
      connect_task.wait(fc::seconds(10));
    }
    catch (const fc::timeout_exception&)
    {
      ilog("timeout connecting to node ${endpoint}", ("endpoint", endpoint_to_probe));
      connect_task.cancel();
      throw;
    }

    fc::sha256::encoder shared_secret_encoder;
    fc::sha512 shared_secret = _connection->get_shared_secret();
    shared_secret_encoder.write(shared_secret.data(), sizeof(shared_secret));
    fc::ecc::compact_signature signature = my_node_id.sign_compact(shared_secret_encoder.result());

    bts::net::hello_message hello("map_bts_network", 
                                  BTS_NET_PROTOCOL_VERSION,
                                  fc::ip::address(), 0, 0,
                                  my_node_id.get_public_key(), 
                                  signature,
                                  chain_id,
                                  fc::variant_object());
    
    _connection->send_message(hello);
  }
  void start(const fc::ip::endpoint& endpoint_to_probe,
             const fc::ecc::private_key& my_node_id,
             const graphene::chain::chain_id_type& chain_id)
  {
    _remote = endpoint_to_probe;
    fc::future<void> connect_task = fc::async([this](){ _connection->connect_to(_remote); }, "connect_task");
    try
    {
      connect_task.wait(fc::seconds(10));
    }
    catch (const fc::timeout_exception&)
    {
      ilog("timeout connecting to node ${endpoint}", ("endpoint", endpoint_to_probe));
      connect_task.cancel(__FUNCTION__);
      throw;
    }

    fc::sha256::encoder shared_secret_encoder;
    fc::sha512 shared_secret = _connection->get_shared_secret();
    shared_secret_encoder.write(shared_secret.data(), sizeof(shared_secret));
    fc::ecc::compact_signature signature = my_node_id.sign_compact(shared_secret_encoder.result());

    graphene::net::hello_message hello("network_mapper",
                                  GRAPHENE_NET_PROTOCOL_VERSION,
                                  fc::ip::address(), 0, 0,
                                  my_node_id.get_public_key(),
                                  signature,
				  chain_id,
                                  fc::variant_object());

    _connection->send_message(hello);
  }
Exemple #4
0
void    signed_transaction::sign( const fc::ecc::private_key& k )
{
    try {
        sigs.insert( k.sign_compact( digest() ) );
    }
    FC_RETHROW_EXCEPTIONS( warn, "error signing transaction", ("trx", *this ) );
}
Exemple #5
0
   void pow::create( const fc::ecc::private_key& w, const digest_type& i ) {
      input  = i;
      signature = w.sign_compact(input,false);

      auto sig_hash            = fc::sha256::hash( signature );
      public_key_type recover  = fc::ecc::public_key( signature, sig_hash, false );

      work = fc::sha256::hash(recover);
   }
Exemple #6
0
 void signed_transaction::sign( const fc::ecc::private_key& signer, const digest_type& chain_id )
 {
    signatures.push_back( signer.sign_compact( digest( chain_id ) ) );
 }
Exemple #7
0
 void                         subscribe_message::sign( const fc::ecc::private_key& k )
 {
    sig = k.sign_compact( digest() );
 }
 void peer_connection::signin( const fc::ecc::private_key& key )
 {
    auto sig = key.sign_compact( fc::sha256::hash( (char*)&_shared_secret, sizeof(_shared_secret) ) );
    auto self = shared_from_this();
    fc::async( [=](){ self->send_message( signin_request( sig ) ); } );
 }
 void signed_block::sign( const fc::ecc::private_key& trustee_priv_key )
 {
    trustee_signature = trustee_priv_key.sign_compact( id() );
 }
Exemple #10
0
 void signed_block_header::sign( const fc::ecc::private_key& signer )
 { try {
    delegate_signature = signer.sign_compact( digest() );
 } FC_RETHROW_EXCEPTIONS( warn, "" ) }
 void signed_transaction::sign( const fc::ecc::private_key& signer )
 {
    signatures.push_back( signer.sign_compact( digest() ) );
 }
Exemple #12
0
 void signed_block_header::sign( const fc::ecc::private_key& signer )
 {
    witness_signature = signer.sign_compact( digest() );
 }