peerplays-fc/include/fc/dh.hpp

29 lines
663 B
C++
Raw Normal View History

#ifndef _FC_DH_HPP_
#define _FC_DH_HPP_
2012-09-11 03:57:11 +00:00
//#include <fc/vector.hpp>
#include <vector>
#include <stdint.h>
namespace fc {
struct diffie_hellman {
diffie_hellman():valid(0),g(5){}
bool generate_params( int s, uint8_t g );
bool generate_pub_key();
bool compute_shared_key( const char* buf, uint32_t s );
2012-09-11 03:57:11 +00:00
bool compute_shared_key( const std::vector<char>& pubk);
bool validate();
2012-09-11 03:57:11 +00:00
std::vector<char> p;
std::vector<char> pub_key;
std::vector<char> priv_key;
std::vector<char> shared_key;
bool valid;
uint8_t g;
};
} // namespace fc
#endif