void file::write_from_string( const string_ref path, const byte_buffer_ref content ) { io::file_stream f(path, io::file_access::write); f.write(content.get_buffer(), content.get_size()); }
void circuit_node::set_shared_secret( const crypto::big_integer& peer_public, const byte_buffer_ref kh // derivative key data, for verification of derivation ) { // assert(kh.get_size() == 20) crypto::big_integer shared_secret = _dh.get_shared_secret(peer_public); auto key_material = derive_keys(shared_secret.to_bytes()); if (memcmp(key_material.get_buffer(), kh.get_buffer(), kh.get_size()) == 0) { _crypto_state = new circuit_node_crypto_state(key_material); } }