BitShares-Core  4.0.0
BitShares blockchain implementation and command-line interface 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 
std::vector< char > priv_key
Definition: dh.hpp:18
uint8_t g
Definition: dh.hpp:21
bool generate_params(int s, uint8_t g)
Definition: dh.cpp:13
int init_openssl()
Definition: openssl.cpp:61
bool compute_shared_key(const char *buf, uint32_t s)
Definition: dh.cpp:89
bool validate()
Definition: dh.cpp:32
bool generate_pub_key()
Definition: dh.cpp:48
std::vector< char > shared_key
Definition: dh.hpp:19
std::vector< char > pub_key
Definition: dh.hpp:17
Definition: api.hpp:15
diffie_hellman()
Definition: dh.hpp:9
std::vector< char > p
Definition: dh.hpp:16