66 auto bn_p = BN_bin2bn( (
unsigned char*)&
p.front(),
p.size(), NULL );
67 auto bn_pub_key = BN_bin2bn( (
unsigned char*)&
pub_key.front(),
pub_key.size(), NULL );
68 auto bn_priv_key = BN_bin2bn( (
unsigned char*)&
priv_key.front(),
priv_key.size(), NULL );
69 auto bn_g = BN_bin2bn( (
unsigned char*)&
g, 1, NULL );
70 DH_set0_pqg(dh.obj, bn_p, NULL, bn_g);
71 DH_set0_key(dh.obj, bn_pub_key, bn_priv_key);
75 if( !fc::validate( dh, valid ) )
81 BN_bin2bn( (
unsigned char*)
buf,
s, pk );
83 DH_compute_key( (
unsigned char*)&
shared_key.front(), pk, dh );