i2pd/libi2pd/NTCP2.h

34 lines
707 B
C
Raw Normal View History

2018-06-05 19:53:13 +03:00
#ifndef NTCP2_H__
#define NTCP2_H__
#include <inttypes.h>
#include <memory>
#include "RouterInfo.h"
#include "TransportSession.h"
namespace i2p
{
namespace transport
{
class NTCP2Session: public TransportSession, public std::enable_shared_from_this<NTCP2Session>
{
public:
NTCP2Session (std::shared_ptr<const i2p::data::RouterInfo> in_RemoteRouter = nullptr); // TODO
~NTCP2Session ();
private:
2018-06-05 22:37:08 +03:00
bool KeyDerivationFunction (const uint8_t * rs, const uint8_t * pub, uint8_t * derived);
2018-06-05 19:53:13 +03:00
void CreateEphemeralKey (uint8_t * pub);
2018-06-05 23:15:33 +03:00
void SendSessionRequest (const uint8_t * iv, const uint8_t * rs);
2018-06-05 19:53:13 +03:00
private:
uint8_t m_ExpandedPrivateKey[64]; // x25519 ephemeral key
};
}
}
#endif