BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet software
dh.hpp
Go to the documentation of this file.
1 #pragma once
2 #include <fc/crypto/openssl.hpp>
3 #include <vector>
4 #include <stdint.h>
5 
6 namespace fc {
7 
8  struct diffie_hellman {
10  bool generate_params( int s, uint8_t g );
11  bool generate_pub_key();
12  bool compute_shared_key( const char* buf, uint32_t s );
13  bool compute_shared_key( const std::vector<char>& pubk);
14  bool validate();
15 
16  std::vector<char> p;
17  std::vector<char> pub_key;
18  std::vector<char> priv_key;
19  std::vector<char> shared_key;
20  bool valid;
21  uint8_t g;
22  };
23 
24 } // namespace fc
25 
26 
fc::diffie_hellman::diffie_hellman
diffie_hellman()
Definition: dh.hpp:9
fc::diffie_hellman::validate
bool validate()
Definition: dh.cpp:32
openssl.hpp
fc
Definition: api.hpp:15
fc::diffie_hellman::generate_pub_key
bool generate_pub_key()
Definition: dh.cpp:48
fc::diffie_hellman::shared_key
std::vector< char > shared_key
Definition: dh.hpp:19
fc::diffie_hellman
Definition: dh.hpp:8
fc::diffie_hellman::valid
bool valid
Definition: dh.hpp:20
fc::diffie_hellman::g
uint8_t g
Definition: dh.hpp:21
fc::diffie_hellman::generate_params
bool generate_params(int s, uint8_t g)
Definition: dh.cpp:13
fc::diffie_hellman::p
std::vector< char > p
Definition: dh.hpp:16
fc::diffie_hellman::compute_shared_key
bool compute_shared_key(const char *buf, uint32_t s)
Definition: dh.cpp:89
fc::diffie_hellman::priv_key
std::vector< char > priv_key
Definition: dh.hpp:18
fc::init_openssl
int init_openssl()
Definition: openssl.cpp:63
fc::diffie_hellman::pub_key
std::vector< char > pub_key
Definition: dh.hpp:17